2

I must be turning a corner because I keep thinking of moving my text drafts off my Windows machine and onto my Linux box to get the convenience of editing them in Vim instead of Notepad++.

One thing I am going to miss though is Notepad++'s buffer window on the left that shows all my files. I just click on a file to open it in the view. Sublime Text has a similar ability, I believe, although I do not use Sublime.

Is there a way to get a pane like this that would show all the buffers, for example, in Vim and have a number or something so you could quickly activate whichever one you want? In Notepad++ I usually have about 50 to 60 different text files loaded at any given time.

In Notepad++ this functionality is called "Document List Panel" (Settings / General / Document List Panel show), shown on the left below:

enter image description here

2
  • 1
    I think the bufexplorer plugin can do this, but I never really tried it myself. Also see this list for some other options. Commented Aug 13, 2016 at 13:21
  • 1
    @Carpetsmoker I am actually aware of that list and have investigated some of those plugins.The problem is that the list is unbelievably long, there are like 25 different buffer-related plugins. Also, using a plugin rather than native functionality always introduces complexity. Therefore, I was hoping for the voice of experience to help me figure out the simplest option. Commented Aug 13, 2016 at 20:16

2 Answers 2

7
  1. You can use GVim on Windows so Vim is not really a valid reason for switching to Linux.

  2. You can display a list of buffers with :ls.

  3. For the last time: Read The Fantastic Manual.

4
  • 2
    :ls does not open a permanent pane, it just lists the buffers temporarily Commented Aug 12, 2016 at 19:25
  • 3
    You don't need it to be permanent, that's completely superfluous.
    – romainl
    Commented Aug 12, 2016 at 19:29
  • 1
    The problem with ls is that it lists all buffers. In case one has the following buffers opened: 1. terminal buffer, 2. NERDTree buffer, 3...100. Some regular file opened. Is there a way to list buffers corresponding to regular files only? Precisely I want to switch over file buffers and bind it to Tab to display it in a particular active viewport. This would be similar to what most IDEs have with their CTRL+Tab binding to go to the next tab pane.
    – St.Antario
    Commented Dec 1, 2019 at 6:19
  • 1
    @romainl What works for you doesn't work for everyone. That's why (good) software and programming languages and editors are so configurable. I think a persistent buffer list would be pretty useful. Anyone who uses Vim with tabs probably feels a similar way. Commented Jan 5, 2023 at 16:20
6

I would also add that in gVim you can get a very close approximation to this feature. If you click on the buffers menu item and then click the "tear off" (--✂-----) button. It opens up a little window that shows you all your buffers and does pretty much what you want. You can also do this with :tearoff Buffers.

I.E. Buffer window

7
  • I have been a little reluctant to get involved with gVim, both because I like to use the keyboard and I often use terminal sessions, so I would have to learn X11 forwarding, which I suspect is laggy and complicated. So, I am kind of hoping for a text-based solution. Commented Aug 12, 2016 at 19:30
  • 1
    @TylerDurden I don't know about X11 forwarding, but just because you use gVim doesn't mean you have to use the mouse. :P gVim is my main use of vim and I hardly ever use the mouse on it. You can even turn the mouse features off if you really wanted to.
    – Tumbler41
    Commented Aug 12, 2016 at 19:34
  • I use gvim (7.4.461) e.g. on Linux. I don't find the "tear off" button. How do I get this to work on Linux? @romainl: :ls is too slow to be an alternative. Commented Aug 12, 2016 at 20:30
  • 1
    You can also try :tearoff Buffers
    – Tumbler41
    Commented Aug 12, 2016 at 20:39
  • It looks like the :tearoff command is available on Windows only. You can still "tear off" menus by using the interface, but not with the command it seems... Commented Aug 12, 2016 at 21:57

Your Answer

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

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