Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm surprised that I haven't been able to find an answer to this, but maybe I'm missing something obvious: is it possible to keep a buffer list per window? I often have around 4 splits, and each one typically serves a specific purpose: CSS in one, JS in another, HTML in a few others, etc.

What I'm probably looking for is a plugin that accomplishes this. Lately I've been using BufExplorer, which does have a setting allowing you to keep its list of buffers per tab, but not per window.

I really like the MRU listing that BufExplorer has, but I find it annoying that it's based on my global list of buffers - what I want is a MRU history per window.

share|improve this question

migrated from stackoverflow.com Aug 9 '11 at 19:02

This question came from our site for professional and enthusiast programmers.

    
You can't find it because it hasn't yet been built. Most nearest-neighbors are identified in this Q & A –  New Alexandria Aug 25 '12 at 17:36
add comment

4 Answers 4

IMHO, What you really need is a Work Space manager.

you can find one for vim @ http://www.vim.org/scripts/script.php?script_id=1410

It will provide you following commands:

:WsAddFile              Add a new file to the workspace.                  
:WsAddGroup             Add a new group to the workspace.                 
:WsClose                Close the workspace window.                       
:WsInsertFile           Insert a file.                                    
:WsInsertGroup  Insert a group.                                           
:WsOpen         Open a workspace and display it in a window.              
:WsRun          Run a command using the selected unquoted file names.     
:WsRunq         Run a command using the selected quoted file names.       
:WsSave         Save the workspace.                                       
:WsSessionOpen  Open the workspace and Vim session.                       
:WsSessionSave  Save the workspace and the Vim session.                   
:WsToggle               Open or Close the workspace window. 

I've a screen shot of working with Workspace manager with 4+ windows posted on my fb, you can view it there (which is public).

It's not exactly a list of buffers as you wanted it, but you can open files in different windows, and in multiple buffers in same window.

In the later case, workspace manager will serve as a buffer list. As you can see in screenshot, I've grouped files into different groups.

This is as close as what you can get, AFIK.

Good day.

share|improve this answer
add comment

Why shoehorn that level of window management into vim? I do occasionally use split windows - I have Ctrl-F mapped to a find-in-files style grep command that appears in a split window, and I also use vimdiff on occasion.

But do you really want permanent window management in vim? PuTTY connection manager and all sorts of terminal emulators let you split the terminals how you want, and then run separate vim sessions in each.

share|improve this answer
    
Can you share registers between vim instances? This is always my number one reason for not wanting multiple instances of vim running: I can't yank from one and put in the other. –  sh1ftst0rm Mar 10 at 13:04
add comment

have NERDTree open on the left. >

I have several buffers open (only one visible in the main view... call it "buffer 1" )

I now go to NERDTree and select another file that I just want to look at really quick or copy something from. So I open that file from NERDTree and buffer1 is correctly hidden and I'm now looking at the buffer I just opened (call it buffer 2)

I now want to completely quit this buffer 2 and go back to editing buffer 1, but when I do :q on buffer 2 I end up looking at just one large NERDTree and I have to redisplay buffer1. ... [show rest of quote]

I do not use Nerdtree, but it sounds like you should be typing Ctrl-^ (probably Ctrl + the 6 key) to switch back to buffer1.

share|improve this answer
add comment

I'm not aware of such a plugin.

One quick way to open a buffer of a specific file is to use FuzzyFinder's :FufBuffer command. It'll open a list of all opened buffers (excluding the one in your current window) for easy access. I've got mine bound to ,fn. It would allow me to, for example, quickly see all css files with ,fncss or all js files with ,fnjs. FuzzyFinder is great for getting to that file/buffer/directory/etc you want with minimal effort (not just this particular use case).

However, i suspect you're looking for something which will allow you to use :bn and :bN (or whatever you have those mapped to, cannot remember if ctrl-n/p are default or my custom) to switch between your buffers of a specific file type.

Perhaps, you could make a plugin that gives you commands to allow switching to the previous/next buffers of the same type as the file of the current buffer in the current window.

share|improve this answer
    
BTW, I think managing these separate buffer lists would be more of a pain then relief. –  Hannes May 31 '12 at 5:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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