> I'm trying to redirect a :[range]g matches to a new buffer, then
> continue my work from there
> the issue now is: it looks :g// only repeat last :global command without
> the range
> how do I make even repeat with the same range?
You don't mention how your range was originally defined. If it
was with a visual range, you can continue to use the range
without re-highlighting it visually. Also, you can use the range
"*" (if "*" isn't in 'cpoptions') if you want to be lazy and not
retype "'<,'>", so you could write
:'<,'>g/foo/Frob(getline('.'))
and then type
:*g/baz/Bort(getline('.'))
which you can read about at
:help :*
:help cpo-star
Otherwise, I'm not sure Vim has a built-in way to repeat an
arbitrary range, but you do have a command history you can access
with the up-arrow if you want to scroll back; or you can use the
command-window by typing "q:" (or, if you're in the middle of
typing a command, you can use control+F)
:help c_<up>
:help q:
> this looks really useful if it can be implemented...
I'm not sure there's great utility to adding such functionality as
1) there's not great cause to reuse ranges, and
2) those cases you want to reuse a range, usually it's easiest to
pull it out of the command history and edit it accordingly, or
it's the last-highlighted range for which the "*" works as
described above.
-tim
--
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