2

I'd like to use a few lines somewhere in my vim window to show a list of all the files I have open, and what number they are (ie, which number I need to use to switch to them). Ideally, they would be lined up across the top of the screen, almost like tabs, to save room. I'm trying to prevent having to type :ls to get the number before I switch to a window.

2

Vim 7 does have tabs, you can use these instead of buffers. To open a file in a new tab use :tabnew <filename>. :tabn and :tabp go forwards and backwards. See more info at http://vim.cybermirror.org/runtime/doc/tabpage.txt.

3
  • That's great! Do you know of anyway to use the standard buffer commands with tabs instead? – user3530 Feb 22 '10 at 21:10
  • And I'd vote you up, but I don't have any rep yet – user3530 Feb 22 '10 at 21:10
  • I don't but you appear to have found what you were after. – Martin Hilton Feb 22 '10 at 21:36
2

Maybe this might be useful to you...

map <F4> :ls<CR>:buffer<space>

put this in ur vimrc file.... now when you press <f4> you will be shown the list of buffers and prompted for the one to open.....

I found it somewhere... Whoever did this... its great....

0

This is what I wanted: http://vim.sourceforge.net/scripts/script.php?script_id=159

0
0

Wow a question from almost eight years ago. I recently solved this problem and like to share it here in case others might have the same need.

A plugin in called vim-airline does the job decently.

Just download and install the plugin and put let g:airline#extensions#tabline#enabled = 1 into your configuration file. And after reload your vim you are gonna see a list of buffer names appear on top of your screen where tab names would appear if you have multiple tabs. Note it won't screw up with your tab as the buffer list starts from the left of the screen while the tab list starts from the right.

I am still looking for ways to display the buffer list on the bottom of the screen. I really don't mind having one more lines as the statusline. But still no luck.

So vim-airline is arguably the best solution so far.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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