Hi,
I wanted to thank you guys for the patience, and for all the tips.
I am quite new with Vimscript, so everything is hard to me. But that is the reason I keep trying, to learn and to educate myself. Sorry for bothering you guys.
As I said, trying to educate myself with Vimscript, I am still trying to do it searching for first and last line in the block, and then iterate over them.
So far, that is the best solution I have. It is quite ugly, but seems to work...
function Comment()
let firstline = search('^\s*$', 'bnW') + 1
let lastline = search('^\s*$\|\%$', 'nW', line('$'))
if lastline != line('$')
let lastline = lastline - 1
endif
for linenum in range(firstline, lastline)
let oldline = getline(linenum)
let newline = '#'.oldline
call setline(linenum, newline)
endfor
endfunction
Thanks a lot for everything.
Cheers,
Jose
--
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
Friday, July 22, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment