When I need to work on different projects at the same time I have the folowing workflow:
- I create one tab for each project.
- In each tab I open the files that I want to edit, which makes several buffers.
- Optionnaly if I need to see two (or more) files at the same time I create split windows so I have a tab containing different windows which shows one buffer.
To navigate between my buffers I don't really use
:b [name or number of buffer] instead I created some convenient mappings allowing me to switch between the buffers with
This way to work is pretty good but something bothers me: the buffers are shared between the tabs.
If I open
tab2, if in
tab1 I use several time
:bnext I'll see
file3 in this tab which I don't want to. The workflow I'd want to get is the folowing:
- Start vim (I have a first tab with a buffer in it):
$ vim foo
- Add a buffer to this tab:
- Open a new tab and switch to it:
- Open a new buffer in this tab:
- If I stay in this buffer and do
:bpreviousI'll stay on
bazbuffer (since it is the only one in this tab)
- If I go in the previous tab
:tabpreviousand execute several time
:bnextI'll switch only between
barbuffers but will not see
So here comes my question: Is it possible to bind a set of buffers to a tab and make vim disallow the access to some buffers from another tab than the one they're meant to be in?
Note: I'm aware that using
:b [myBuffer] would be a way to keep a buffer in a tab but when I have 3 or 4 files to edit I feel like I'm really faster using my mappings than typing the buffer name (even if I can type only some characters to match the buffer name).