4 ms·
I do this too. How do you manage switching between open buffers, or closing one without closing the others? I don't have a good solution for the first, and fo
by jraines 15y ago
I do this too. How do you manage switching between open buffers, or closing one without closing the others? I don't have a good solution for the first, and for the latter I find I have to close nerdtree for :bw to work as expected.
- coliveira 15y agouse :ls to list the open buffers. Then use :b<number> to switch between buffers.
- jraines 15y agocool, this is close to what I'd been doing but much faster -- I was typing out :buffer
- psadauskas 15y agoI use minibufexpl[1] to list the open buffers at the top, and have the up/down arrows mapped to :bp/:bn [1] http://www.vim.org/scripts/script.php?script_id=159 http://www.vim.org/scripts/script.php?script_id=159
- ilikepi 15y agoJust to throw in another $0.02... I use bufexplorer[1]. There's something about minbufexpl's list that seems unappealing to me when it spans multiple lines. I also have CTRL-j/CTRL-k mapped to :bnext/:bprev. As for closing a buffer, my main window generally has a single vertical split, so I have the following kludge: map <C-Q> :vert split<CR>:bnext<CR>:wincmd l<CR>:bdelete<CR> This creates another vertical window temporarily, advances to the next buffer in that window, activates the window to the right (which still shows the buffer I'm trying to kill), and then deletes that buffer leaving me with two windows again. Amusingly, my older machines were slow enough to catch a glimpse of the third window, but it disappears too quickly to see on my new machine. [1] http://vim.sourceforge.net/scripts/script.php?script_id=42 http://vim.sourceforge.net/scripts/script.php?script_id=42 edit: described kludge a bit better
- alinajaf 15y agoYou realize that commandT also comes with a 'commandB' command that allows you to navigate open buffers?
- jraines 15y agohmm, just tried <cmd>B, :commandB, and :CommandB and none worked :/ I am using Janus, so maybe it overwrites this. https://github.com/carlhuda/janus https://github.com/carlhuda/janus
- alecthomas 15y agoI think the parent is mistaken. I have been looking for the equivalent of CommandT for buffers for a while, and the closest I've found is this: http://www.vim.org/scripts/script.php?script_id=1890 http://www.vim.org/scripts/script.php?script_id=1890 Unfortunately it's fuzzy file matcher is nowhere near as useful as CommandT's, so you'll have to use them in conjunction.
- wahnfrieden 15y agoThis one is great for both files and buffers: http://www.vim.org/scripts/script.php?script_id=1984 http://www.vim.org/scripts/script.php?script_id=1984 FuzzyFinder
- alinajaf 15y ago:help CommandT ... *:CommandTBuffer* |:CommandTBuffer|Brings up the Command-T buffer window. This works exactly like the standard file window, except that the selection is limited to files that you already have open in buffers. and then later... MAPPINGS *command-t-mappings* By default Command-T comes with only two mappings: <Leader>t bring up the Command-T file window <Leader>b bring up the Command-T buffer window Note that this is only available since 1.1b which was released in March.