the file as I was on after executing a filter command
on the whole file? The function below *works*, but I
have a nagging feeling that I used to know how to do it
in a simpler (and hopefully less rough!) way with
builtins.
Is there any way to count paragraphs (instances of
/\n\s*\n ) before the current line and get back to the
right paragraph based on that?
Is there a way to call a function with a range and have
the function act on the whole range once rather than
line by line, so that I don't have to give the range
as arguments to the function?
function! FilterAndGoBack(filter,...)
let atline = line(".")
let first = 1
let last = "$"
if a:0 > 0
let first = a:1
endif
if a:0 > 1
let last = a:2
endif
exe ":".first.",".last."!".a:filter
exe ":normal ".atline."G"
endfunction
--
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:
Post a Comment