On 6/10/06, o1792 <[EMAIL PROTECTED]> wrote:
Hi,
I'm trying to get better navigating within vim. I tend
work with screens not lines so I use w or b alot
because they don't stop at line ends. What I dislike
about f and F is that they do stop at line ends, which
I myself don't find so suitable.
Ofcourse I can use the search, /, but it needs more
keystrokes. Any advice? Thanks in advance.
Is this what you want ?:
" remap f,F to be multi-line
noremap <silent>f :call OneCharSearch(1)<CR>
noremap <silent>F :call OneCharSearch(0)<cr>
noremap ; n
noremap , N
function! OneCharSearch(forward)
" op is '/' or '?'
let x= getchar()
let c=nr2char(x)
echo 'c='.c
if x == 27 | return | endif
if c == '\' | let x='\\' | endif
if a:forward
silent! exe "norm /\\V".c."\<cr>"
else
silent! exe 'norm ?\\V'.c."\<cr>"
endif
endfun
Yakov