Yakov Lerner wrote:
On 2/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I have a string that has lots of forward slashes. I need to search it
and delete it (e.g. unix path name). I could use a backslash for
everything forward slash and find it in vim. Is there a way I need not
do that? For now, I use 'grep -n' to get the line number and then delete
it. I don't actually type the string, I just use cut-and-paste!
You can use this trick:
:let @/='patterrn/with/slashes'
n
Or this trick in your vimrc:
:command! -nargs=* S let @/=<q-args>|norm n
and then you use
:S pattern/with/slashes
Yakov
1. Note that this will search in the same direction as the latest / or ?
search. You may want to end the command by "norm /" instead.
2. It may be simpler and more straightforward to use just (let's say)
:cmap £ <Bslash>/
then the £ (pound sterling) key (which you may replace by any other key not
used by Vim in command-line mode and conveniently located on your keyboard)
can be used as a substitute for \/ on the command-line.
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
24. You realize there is not a sound in the house and you have no idea where
your children are.