On Wednesday, November 27, 2019 at 1:00:31 AM UTC+13, Igor wrote:
Assuming the current directory has files a.txt, b.txt, c.txt
: args *.txt
: argdo vs
> What happens is: c.txt is displayed left most, then the same c.txt ...
> I expected to see c.txt displayed in one single window, but it it displayed in two windows. Why?
The argdo vs behaves like you'd entered the following sequence:
:vs
:next
:vs
:next
:vs
Each command in isolation is doing its thing correctly. There's three splits,
resulting in four vim windows.
If what you want is as many vim windows as arguments, in order, try
:1,$-argdo vs | wincmd w
:next
Note there's lots of options affecting vim's behaviour here. For example, if you have 'splitright' set, it's simpler:
:set spr
:1,$-argdo vs
:next
Regards, John Little
-- Assuming the current directory has files a.txt, b.txt, c.txt
: args *.txt
: argdo vs
> What happens is: c.txt is displayed left most, then the same c.txt ...
> I expected to see c.txt displayed in one single window, but it it displayed in two windows. Why?
The argdo vs behaves like you'd entered the following sequence:
:vs
:next
:vs
:next
:vs
Each command in isolation is doing its thing correctly. There's three splits,
resulting in four vim windows.
If what you want is as many vim windows as arguments, in order, try
:1,$-argdo vs | wincmd w
:next
Note there's lots of options affecting vim's behaviour here. For example, if you have 'splitright' set, it's simpler:
:set spr
:1,$-argdo vs
:next
Regards, John Little
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/07bbb4a8-dc68-47ca-875c-a90a8a749507%40googlegroups.com.
No comments:
Post a Comment