On Mon, Dec 13, 2010 at 8:18 AM, C K Kashyap <[email protected]> wrote: >> function! VSubLen() >> let a = "'<" >> let b = "'>" >> >> let fn = line(a) == line(b) >> \ ? "col" >> \ : "line" >> >> return eval(fn."(b)"."-".fn."(a) + 1") >> endfunc >> >> vnoremap <Leader>l s<C-R>=VSubLen()<CR> >> nnoremap <Leader>vl i<C-R>=VSubLen()<CR> >> > Thanks Andres. I am however, not sure how to use it. > I managed to get my stuff done using strlen function.
The function returns the length of the last visual selection. Lines if it spans multiple ones, otherwise columns. General solution as opposed to being fully automatic. > > -- > 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 > -- 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
