Wednesday, September 29, 2010

Question? passing visual selection to function

Question? passing visual selection to function

The function BlkInc() puts line numbers at the start of line.

EXAMPLE 1 works
EXAMPLE 2 does not work

Can you explain why?

""-----=-------=-------=-------=-------=-------=-------=-------=
" EXAMPLE 1
function! BlkNum()
'<,'>s/^/\=BlkInc()/
endfun
vmap <F5> :<C-U>call BlkNum()<cr>

""-----=-------=-------=-------=-------=-------=-------=-------=
" EXAMPLE 2
function! BlkNum()
s/^/\=BlkInc()/
endfun
vmap <F5> :call BlkNum()<cr>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: