9

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?
  • 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 '15 at 6:24
  • 2
    Did you read this? – romainl Oct 19 '15 at 6:25
  • 1
    No, the argument list is a subset of the buffer list. – romainl Oct 19 '15 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. – Sato Katsura Oct 19 '15 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 '17 at 18:50
1

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/

  • 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 says reinstate Monica May 26 '18 at 22:07

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.