* Robert Cussons [2006.10.18 06:30]:
> I did notice that between the if and else there
> are " which just act as comments as they are on
> newlines,

Sorry, I should have known that wouldn't come out
right. There's a literal newline between the
quotes. You can enter it by pressing
<CTRL-V><CTRL-M>.

Here's that section of code with the literal
newline entered as two separate characters:

if a:direction == 'b'
   execute "normal ?" . l:pattern . "^M"
else
   execute "normal /" . l:pattern . "^M"
endif

> I was selecting text in visual mode, then
> pressing / or ? and I just get the normal action
> of pressing / or ?

Well you could do it with "/" and "?" but I like
to keep their behavior intact as it is useful to
extend the visual region.

I remapped "*" and "#" instead, as shown in these
lines:

vnoremap <silent> * :call VisualSearch('f')<CR>
vnoremap <silent> # :call VisualSearch('b')<CR>

I prefer that because these don't have any special
meaning in visual mode and it ties in nicely with
the "search next/previous word" function they have
in normal mode.

-- 
JR

Reply via email to