thanks
regards
ping
thanks!
regards
ping
What command do you enter?
What error message is displayed?
First few lines of :version might also be useful (I'm wondering
if you are running the Tiny version, and whether it has some
limit that I have never seen on normal Vim).
John
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
First, that's a hideous command definition (to the degree I went
out to the wiki and changed it to be more legible). If you're
going to use normal mode, the canonical way to clear a register
is to use "qaq" to clear register "a". I prefer the explicit
nature of setting it in Ex with ":let @a=''".
I'd be tempted to make use of the ability to pass ranges to a
command with something like
command! -range=% MyGrep let @a='' | execute
'<line1>,<line2>g//y A' | tabnew | enew | setlocal bt=nofile |
put! a | nohls
which you can read about at
:help command-range
:help <line1>
> 3) repeat 1) on this new buffer(maybe with different range and pattern)
I'd say it's highly unlikely that one would *want* the same range
in this secondary buffer, since it's already been winnowed down
to the specified range by this point. However, the same pattern
makes sense and can be done using the blank pattern as above.
-tim
What is 'enew' for?
I changed the command at:
http://vim.wikia.com/wiki/Redirect_g_search_output
from:
command! Filter let @a='' | execute 'g//y A' | split | enew | setlocal bt=nofile | put! a
to:
command! -nargs=? Filter let @a='' | execute 'g/<args>/y A' | new | setlocal bt=nofile | put! a
which included replacing 'split | enew' with just 'new'.
Is there some point I am missing?
I guess the range stuff should be added on the wiki as it's
pretty nice.
John
On 01/21/2012 07:46 PM, ping wrote:
> I'm using vim to open a lot of text files , each in a tab (so also a
> buffer), it looks I reached the default maximum concurrent file
> numbers (exact 30) and get a warning.
:h 'tabpagemax
regards,
Christian
--
Unordnung: wo nichts am rechten Platz ist.
Ordnung: wo am rechten Platz nicht ist.
30 hostname "WASHDC core"
31 +-- 34 lines: aaa new-model
65 +-- 2 lines: !
67 service password-encryption
68 baseline show-delta-counts
69 !
70 +-- 3 lines: controller sonet 12/0
73 !
74 +-- 3 lines: controller sonet 13/0
77 !
78 +-- 23 lines: controller sonet 4/0
101 +-- 31 lines: !
normally when you yank a folded line, it actually yank the whole texts
that line folded, not only the displayed title.
but I want to also have the option to do the other way -- just yank the
texts that is getting displayed.
this is kind of another good usage of folding -- generate an overview
that can be passed to other places.
regards
ping
On Mi, 18 Apr 2012, ping wrote:
I once posted a similar function here.
Look here:
http://groups.google.com/group/vim_use/msg/571f070987ee35ce
regards,
Christian
--
You've "replied" twice on a thread (albeit one that you yourself
started) that has nothing to do with your subsequent questions. This
means that your questions have been placed in the thread on many (most?)
email readers, which in turn means that those who might have something
to say about your questions but aren't interested in the original ("how
to repeat the last :[range]g with the same range?") won't even see them.
I use seamonkey, myself; with it, I can right click on the "From:" field
and get an option to "compose mail to". Perhaps whatever you use has
something similar. The advantage is that it starts up a new thread, but
will still go to the group without your having to type it in.
Also: please bottom post on this group (its group-approved etiquette,
besides making sensible replies to replies to replies).
Regards,
Chip Campbell