8

This is how I use vim's tabs:

enter image description here

I have shortcuts to move a tab to left/right with <ctrl>j <ctrl>k and to move between tabs with <ctrl>h, <ctrl>l. According to answer to this question, I'm doing it wrong. How to effectively use buffers then? Constantly listing hidden buffers to know which to switch to doesn't seem like an imprevement.

Community
  • 1
  • 1
user1367401
  • 1,030
  • 17
  • 26
  • There [are](http://www.vim.org/scripts/script.php?script_id=1664) [multiple](https://github.com/rson/vim-bufstat) [plugins](http://www.vim.org/scripts/script.php?script_id=159) that utilize either the statusline, the space below the statusline, or an extra split window to show open buffers. That is one option. Also you don't need to switch to buffers by number, `:buffer` will also accept buffer name or a substring of the buffer name as the argument. – Randy Morris Sep 20 '12 at 15:55
  • In addition to the plugins listed by Randy, you should try [ctrlp](http://kien.github.com/ctrlp.vim/) or [fuzzyFinder](http://www.vim.org/scripts/script.php?script_id=1984). – mMontu Sep 20 '12 at 16:55
  • http://vimcasts.org/episodes/working-with-buffers/ – isomorphismes Feb 16 '14 at 11:07

1 Answers1

7

There is no right or wrong way of handling buffers in Vim. First, learn and understand the difference between buffers, windows, and tab pages. Then adopt a style that suits you. There are many "buffer management" plugins on http://www.vim.org/, but you can also just use the built-in commands like :buffer together with file completion.

If you solely stick to the "one file per tab" rule (like in a browser), you're losing the benefits of window splits, and you'll still occasionally encounter splits in the form of the preview and quickfix windows, and in order to use diff mode.

I mostly use tab pages to separate different workspaces (I only have a single GVIM instance running); sometimes I open the same set of buffers in different tabs in different arrangements, like the perspectives in IDEs such as Eclipse.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324