tags:

views:

252

answers:

4

I recently changed from notepad++ to Vim. In notepad++ I used to be aware of my open files by seeing them as tabs, so when I wanted to close or change them I just pressed Shit-Tab or Ctrl-W. In Vim there are also tabs, but when I use them I feel like I'm just going back to my notepad++ way of managing my files. Is there a good way of list, manage, switch and delete buffers other than splitting them?

+2  A: 

You can use these commands:

  • ls - list all open buffers
  • bp, bn - switch to the previous or next buffer
  • b number - switch to the buffer with that number
  • b text - switch to the buffer whose name includes the string text
Nathan Fellman
+1  A: 

There are so many ways to deal with buffers in vim.

CTRL-^ to switch between buffers.

:q is the same as Ctrl-W

For further details see http://vim.wikia.com/wiki/Easier_buffer_switching

Yada
+5  A: 

Yep. I recommend a buffer explorer plugin as well as learning buffer commands. I use this plugin.

http://www.vim.org/scripts/script.php?script_id=42

The buffer paradigm is quite elegant once you are used to it. Less visual clutter. but you are free with vim to find your own thing

michael
+1  A: 

I've tried several setups for Vim. My previous was one where I tried to use tabs instead of buffers. It was not very satisfying.

Now I've returned to buffers and for navigating files and buffers I use only the NERDTree and fuzzyfinder (I guess ex Textmate users may prefer fuzzyfinder_textmate) plugins, both are great.

For locating files I use either NERDTree bound to n or fuzzyfinder's File mode. For navigating open buffers I use fuzzfinder's buffer mode solely, bound to b.

Recently I also discovered that I could switch to the previously open buffer with Ctrl-6 (I think maybe that is Ctrl-^ on most keyboard).

vorpyg
Hm, i just noticed that <leader> in front of n and b got stripped…
vorpyg