0

Once in a while I do work on a large number of files (i.e. today it was about 1,700) using a command such as:

gvim `find . -name *.cpp`

and I use the "n" (no changes) or "wn" (made a change) to go through all my files.

Once in a while I notice I missed something and would like to restart at a certain position. Is there a way to reset that buffer position? I found that I could use a <count>:n or <count>:N but that's not as practical as specifying that this or that specific buffer should now be the one (i.e. I have to do the math...)

4

With :n you are going through the argument list. You can use :args to see where you are in the current argument list. You can use :first to start at the beginning and use :last to go to the last argument. You can also use :previous to go to the previous argument. To add files to the argument list you can use the :argadd and argedit command. And finally if you want to be at a specific argument, use :Nargu command (e.g. to edit the third file from your argument list, use :3argu.

Note, there is also the bufferlist, which is independent of the argument list. You can move through the buffer list using :bnext and similar commands.

Read the detail about it at :h arglist and :h 07.2

  • Very cool! I've also been wondering about an inter-buffer next/previous capability. – Alexis Wilke Jan 28 '18 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.