10

So many choices! So confusing!

  1. When should one be used in preference to another?
  2. How do these relate to each other?
  3. What are the differences between them, anyway?
  4. How do they affect commands you type in?
  5. How do they relate to registers, macros, marks, options, and command history?
  6. Which nest inside which others, for example is a tab a subdivision of a window like in typical GUI programs, or is a window a subdivision of a tab?
  7. How does this relate to multiple command line arguments (the arglist) accessible through :next and :prev?
  8. And lastly, which of these (if any) are vi compatible?
10
  • I was going to "post Q&A style" and make it a community wiki, but I realized when I expanded my question list a bit that I actually don't understand these nearly well enough to begin the wiki. Maybe to clean up the wording a little once it's made.
    – Wildcard
    Oct 19, 2015 at 6:24
  • 2
    Did you read this?
    – romainl
    Oct 19, 2015 at 6:25
  • 1
    No, the argument list is a subset of the buffer list.
    – romainl
    Oct 19, 2015 at 7:56
  • 5
    Initially each argument creates a buffer, but then buffers and arguments start having their own independent lives. You can change the list of arguments with :args (which doesn't change buffers), and you can delete buffers, including the ones corresponding to arguments, with :bdelete (which doesn't affect the list of arguments). Editing new files with :e creates new buffers, and so does, say, opening help, but neither changes the list of arguments. And so on, and so forth; you can't rely on any relation between the two beyond startup. Oct 19, 2015 at 14:15
  • 1
    I actually found that answer very unhelpful, everything was layered in Vim terms whilst insulting other text editors. It's great if you already know what tab pages are, but not helpful if you're trying to learn. For that question I found Jonathan Brink's answer easier to understand.
    – icc97
    Mar 30, 2017 at 18:50

1 Answer 1

2

I am fairly new here, so not allowed to comment and have to post this as an answer. I guess romainl's answer is pretty definitive and there's this post that makes for a good 'beginner-friendly' version of it: https://dockyard.com/blog/2013/10/22/vim-buffers

And then there's this post, maybe a little biased, but lays out the argument pretty well: https://joshldavis.com/2014/04/05/vim-tab-madness-buffers-vs-tabs/

2
  • You can easily convert your post to a full-scaled answer by copying the most essential parts of the links here. Btw, also link-only answers are forbidden, because nobody wants a site full with answers full with rotten links. But the workaround is very easy (copy-paste the essential part) and quite attractive for the voters/reviewers.
    – peterh
    May 26, 2018 at 22:07
  • The second link not mentioned arglist at all Nov 7, 2020 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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