Updating argument

53 views
Skip to first unread message

Paul

unread,
May 3, 2016, 5:27:40 AM5/3/16
to vim...@googlegroups.com
I start vim with "vim file1 file2". :args shows I'm on file1. I change buffer with :bnext. :args shows I'm still on file1. Is there some setting that will update the argument to be on the same buffer that I change to, or is there some reason why that would be a bad idea?

Ben Fritz

unread,
May 3, 2016, 12:06:45 PM5/3/16
to vim_use
On Tuesday, May 3, 2016 at 4:27:40 AM UTC-5, Jan wrote:
> I start vim with "vim file1 file2". :args shows I'm on file1. I change buffer with :bnext. :args shows I'm still on file1. Is there some setting that will update the argument to be on the same buffer that I change to, or is there some reason why that would be a bad idea?

Not a setting, a command.

Instead of :bnext, use :next to switch to the next argument in the list.

Paul

unread,
May 4, 2016, 10:27:05 AM5/4/16
to vim...@googlegroups.com
What I mean is if I change to buffer 2 - by any means, including ":buffer 2", which happens to also be argument 2 (or argument n), I'd like :arglist to reflect that.

Nikolay Aleksandrovich Pavlov

unread,
May 6, 2016, 9:29:03 PM5/6/16
to vim...@googlegroups.com
I am wondering what for do you use arglist so you need this? I would
not say that arglist is a very useful thing, if :arg* commands were
not (nearly?) the only ones accepting multiple arguments I would even
say that it is rather useless.

>
>
> --
> --
> 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+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ben Fritz

unread,
May 6, 2016, 11:52:18 PM5/6/16
to vim_use
On Friday, May 6, 2016 at 8:29:03 PM UTC-5, ZyX wrote:
> 2016-05-04 17:26 GMT+03:00 Paul <googl...@rainslide.net>:
> > On Tuesday, 03 May, 2016 at 17:06:45 BST, Ben Fritz wrote:
> >>
> >> On Tuesday, May 3, 2016 at 4:27:40 AM UTC-5, Jan wrote:
> >>>
> >>> I start vim with "vim file1 file2". :args shows I'm on file1. I change
> >>> buffer with :bnext. :args shows I'm still on file1. Is there some setting
> >>> that will update the argument to be on the same buffer that I change to, or
> >>> is there some reason why that would be a bad idea?
> >>
> >>
> >> Not a setting, a command.
> >>
> >> Instead of :bnext, use :next to switch to the next argument in the list.
> >
> >
> > What I mean is if I change to buffer 2 - by any means, including ":buffer
> > 2", which happens to also be argument 2 (or argument n), I'd like :arglist
> > to reflect that.
>
> I am wondering what for do you use arglist so you need this? I would
> not say that arglist is a very useful thing, if :arg* commands were
> not (nearly?) the only ones accepting multiple arguments I would even
> say that it is rather useless.
>

Arg list is good for when you want to make sure you look at or make changes to all files in a specific list, it can help you keep your place if you navigate with :next until the end.

It's also good, obviously, for the :argdo command.

That's about all I've got, though.

Paul

unread,
May 7, 2016, 4:58:59 PM5/7/16
to vim...@googlegroups.com
On Saturday, 07 May, 2016 at 02:28:52 BST, Nikolay Aleksandrovich Pavlov wrote:
>I am wondering what for do you use arglist so you need this? I would
>not say that arglist is a very useful thing, if :arg* commands were
>not (nearly?) the only ones accepting multiple arguments I would even
>say that it is rather useless.

The arglist can be very useful: http://vimcasts.org/episodes/meet-the-arglist/

Gaetano Cajetan

unread,
May 7, 2016, 10:12:47 PM5/7/16
to vim...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages