Code Monkey home page Code Monkey logo

vim-bufferline's Introduction

vim-bufferline

Super simple vim plugin to show the list of buffers in the command bar.

screenshots

in the statusline

img

or the command bar

img

configuration

:help bufferline

installation

  • pathogen
  • git clone https://github.com/bling/vim-bufferline ~/.vim/bundle/vim-bufferline
  • neobundle
  • NeoBundle 'bling/vim-bufferline'
  • vundle
  • Plugin 'bling/vim-bufferline'
  • vam
  • call vam#ActivateAddons([ 'vim-bufferline' ])
  • vim-plug
  • Plug 'bling/vim-bufferline'

credits

This was inspired by the buftabs script.

license

MIT License. Copyright (c) 2013 Bailey Ling.

vim-bufferline's People

Contributors

bentomas avatar bling avatar gaelan avatar johncf avatar markwu avatar orlp avatar timofurrer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-bufferline's Issues

active_buffer delimiters aren't applied if setted on vimrc

I have set in my vimrc file the characters for the active buffer left and right

let g:bufferline_active_buffer_right = "]"
let g:bufferline_active_buffer_left = "["

but it is not applying these changes and applies the other changes (tested bufnr, solo_highlight and modified and all of them work).

using those commands inside a vim session it applies the changes correctly.
I have tested this with the minivimrc you provide and the same thing happens.

Show short path instead of filename only?

How can we display buffer with its short path like: ~/.con/nv/pa/d/s/vi/README.md (as full path of ~/.config/nvim/pack/default/start/vim-bufferline) instead of display only file name README.md?

this is because we can have multiple buffers with same filename, and showing path as above will help distinguish buffers better.

How can we achieve this?

install instructions

please update install instructions in readme.md

i prefer using vundle installation steps.

Toggle bufferline?

Hi- is there a way to toggle the bufferline on and off, on the fly, sort of?

If I set it to off in my vimrc:

let g:bufferline_echo = 0

Can I then toggle it back on when I need it? Only, I have too many buffers open and when the bufferline is displayed I have to stop and press enter (or Esc) to move on to the next one with Ctrl + PageUp/Down. It would be nice to know how to display the bufferline only when I want it.

Cheers!

Can't get colors for Inactive buffers and active buffers.

Hi Bailey,

Thanks for your awesome work.

I would like to have colors to indicatie if there is a inactive buffer or active buffer. But the option, mentioned in the documentation, didn't worked for me either:

let g:bufferline_active_highlight = 'StatusLine'
let g:bufferline_inactive_highlight = 'StatusLineNC'

I have both set in my Vimrc. And yes, the color properties of the StatusLine and StatusLineNC are setted in the colorscheme file. When I switched to another colorschemes, the different colors in bufferline are not showed either. All colors in bufferline are still using the same color as the rest of my statusline.

Then I tried to unset my Vimrc. Only the options and default colorscheme of GVIM 7.4.415 and latest Bufferline, with windows 7 x64. The empty Vimrc with these settings:

  let g:bufferline_active_buffer_left = ' [ '
  let g:bufferline_active_buffer_right = '] '
  let g:bufferline_show_bufnr = ' 1 '
  let g:bufferline_inactive_highlight = 'StatusLineNC'
  let g:bufferline_active_highlight = 'StatusLine'

But It didn't worked either. I changed the colors in Vim default colorscheme Delek (you can find it too), to differentiate StatusLineNC and StatusLine. But it didn't helped either.

Is something wrong with Bufferline recently, in combination with Windows Gvim?

make most active buffer to be displayed in the front

Hi,

Is there a way to make most active buffers to be displayed in the beginning of command bar or status line?

For instance, if you open a buffer and its buffer number 23, but if youve worked on something in that buffer window, its buffer number will be bumped to 1 so it can be displayed in the beginning of command bar. That way, it will be easier to switch even though the buffers you are working on are opened later.

Thanks.

Bufferline broken when "autochdir" is enabled

Minimal .vimrc to reproduce the issue:

call plug#begin('~/.config/nvim/plugged')

Plug 'vim-airline/vim-airline'
Plug 'bling/vim-bufferline'

call plug#end()

set autochdir " if this is commented out, bufferline works

Expected result: when opening two files with nvim, the two open filenames are shown in airline.
Actual result: only the currently active buffer is shown.

This happens on neovim v0.2.0, not tested on vim yet.

Question: Is there a way to switch off the tabline

When using bufferline the tab heads at the top aren't hidden. I see no use of them when bufferline shows the buffers in the statusline. Is the presence of top bar while using bufferline normal? Is there a way to hide the bar?

Consistency between vim-airline and vim-bufferline

Is there any chance to make the display of buffers between vim-airline and vim-bufferline more consistent, i.e. have them follow the same format? What bothers me the most is that airline displays "[No Name[" for unnamed buffers, while bufferline shows an empty string.

DOS style line breaks do not work under *nix

For a few months now I have to apply the dos2unix tool on the file plugin/bufferline.vim as it contains DOS style line breaks which do not work under unixoid operating systems (e.g. Linux). I hoped for it to be recognized and delayed filing this bug too often. This happened sometime this year, so I assume it was not intentional. Please change it back!

Error thrown after adding this plugin:
$ vim
Error detected while processing /home//.vim/bundle/vim-bufferline/plugin/bufferline.vim:
line 1:
E15: Invalid expression: !exists('g:bufferline_active_buffer_left')^M
line 127:
E171: Missing :endif
Press ENTER or type command to continue

Possible way to fix this issue:
$ dos2unix /home//.vim/bundle/vim-bufferline/plugin/bufferline.vim
dos2unix: converting file /home//.vim/bundle/vim-bufferline/plugin/bufferline.vim to Unix format ...

OMG, I am very very sorry, this is not true at all! I'm installing plugins via vundle and I just used the wrong bundle string (vim-bufferline instead of bling/vim-bufferline) which caused vundle to install the vim-scripts version of this plugin! Please forgive me...

Huge Command-T slowdown with vim-bufferline installed

Hi.
Pretty much as title says. I am using airline and bufferline with following settings:

let g:airline#extensions#bufferline#enabled = 0
let g:airline_powerline_fonts = 1
let g:bufferline_echo = 1

and Command-T with no settings, which is extremely slow unless I disable bufferline plugin. Not sure how I can investigate deeper into it.

`:help bufferline` not working

I installed bufferline with Pathogen, and I'm trying to use with vim-airline, but the command quoted above does not work, it simply says "Sorry, there's no help for bufferline".

What seems odd to me is that bufferline is actually working, it shows my buffers on statusline (I tested removing vim-bufferline from bundle/ to see what happens).

My repository is here (it's very young and undocumented). I'm using a compiled Vim 7.4 on Ubuntu 13.04.

What can be happening?

Show bufferline under tabs

Hi,

Is it possible? I'm migrating from my wrong usage of tabs as buffers, but still bufferline is just like tabs. Could it be shown in regular place?

Thanks.

Statusline integration does not respect "rotate" option

First of all, thank you for this plugin! I have found it to be really useful. Recently, I came across this issue:

It seems that the "rotate" option only works with command bar mode. If I use these settings:

let g:bufferline_show_bufnr = 0
let g:bufferline_rotate = 2
let g:bufferline_echo = 0
autocmd VimEnter *
  \ let &statusline='%{bufferline#refresh_status()}'
  \ .bufferline#get_status_string()

I get behavior like this:

All good, current buffer highlighted
screen shot 2014-12-13 at 8 18 06 pm

But when the current buffer is changed, the statusline does not scroll
screen shot 2014-12-13 at 8 18 13 pm

If I comment out the last three lines of that config, I see:

Current tab is highlighted
screen shot 2014-12-13 at 8 19 13 pm

Switch to a neighboring buffer, and bufferline scrolls as expected
screen shot 2014-12-13 at 8 19 26 pm

vim 7.4
vim-bufferline 706e059

Any thoughts would be greatly appreciated. Thanks!

Buffer indices are incorrect

If I open a new buffer, delete it, and then open another new buffer, the newest one has the same number/index as the one I just deleted, while vim's buffer counter was incremented.

To reproduce:

  1. $ vim foo
  2. :e bar
  3. :b 1
  4. :bd 2
  5. :e baz

bufferline now shows 1:foo [2:baz ], while :ls shows:

  1 #h   "foo"                          line 1
  3 %a   "baz"                          line 1

buffer on command line remains hidden too often

I am using
let g:bufferline_echo = 1
and no airline integration so I have the list only in command bar (that is what I want). Works great, but there is still one issue, many times, some message hides the list of buffers, and remains hidden until some more I do some more things and it finally appears again.

For example if I search and cannot find anything the msg 'Pattern not found' remains there for ever. Is there something that can be done so in some seconds the buffer list takes over again?

thanks!

[Enhancement] Show only buffers not open in windows

It would be nice if the list of buffers was the set of all buffers minus the list of all buffers open in a window plus this windows buffer.

example:

A vim session with the following windows and tabs:

  1. one window, with file A
  2. vsplit file B and C

Not in a window: buffers D and E

I would then expect:

  • the window with A to show: A D E
  • the window with B to show: B D E
  • the window with C to show: C D E

Does that make sense?

Add an option to disable auto (random) echo of buffer status

Hey, thanks for this minimal plugin.

Could we have an option to disable the call to echo() on CursorHold event?

The default behaviour on events like BufWinEnter, WinEnter, InsertLeave, VimResized is perfect but the CursorHold event causes the messege to flicker at unwanted times. At its worst, this can also block some important message the user is reading (in the "command bar").

Looks like it's been a bit deserted here lately, so hope the plugin isn't "complete" (and everything is okay).

Display buffer indices only' on bufferline? (not status or command line)

First thanks for the plugin. So I was a bit curious why you elected to show buffer indices in the statusline/commandbar and not the tabline - it's just confusing. why would I display buffers at one line and look at their indices at another? here's a screen shot

result

I was wondering if there's any way to hide the indices/buffernumbers from the commandbar and statusline and just show them at the top tabline? - I think that's more intuitive (that's what I expected to see at first) - or at least just hide the indices/buffers from the statusline - then I could hide the tabline and just use the commandbar to see the tab with their indices. and just let the statusline display the current file I'm editing. I just want to look at one place.
My settings:

"bufferline"
    let g:bufferline_modified = '*'

"Airline"
    " Enable the list of buffers
    let g:airline#extensions#tabline#enabled=1

    " Show just the filename
    let g:airline#extensions#tabline#fnamemod=':t'

    " enable/disable displaying buffers with a single tab
    let g:airline#extensions#tabline#show_buffers = 1

Thanks.

[Enhancement] Limit amount of buffers

Hi.

I'm using bufferline along with vim-airline and works just awesome! On 24" screen. But when I try to use it at my laptop (14") or just small window I can't figure out which buffer am I in. Could you please add option to show only current buffer + limited amount of buffers around it. Kind of like this:

buf1 [ current ] buf2

and there's always just 3. I understand that it can be inconvinient and one won't have complete overview, but still this is much better than looking at other buffers and not seeing your current one.

Thanks.

When only one buffer is open, do not highlight the buffer

I recently started using vim-airline and vim-bufferline, and I use a solarized theme with patched powerline fonts. When I open a single file for editing, the current file is highlighted in the status bar, but since there aren't any separators that match the airline theme, the highlighted region is bounded by vertical lines. While this looks ok with multiple buffers open, it has been throwing me off when there is just a single file.

A potential solution might be to have an option to not show the bufferline if only one buffer is open/listed. I fiddled with the code a bit to try to add it, but found I was needing to refresh the buffer list an extra time, so clearly I was doing something wrong.

Highlight groups for active_modified and inactive_modifed when used in the status line

Could you provide a highlight group for buffer names in the status line corresponding an active and modified buffer? Similarly, I would like a highlight group for buffer names that are inactive while the active buffer is modified.

The reason is that at the moment vim-bufferline is clashing with airline. For example, If I modify a buffer, all buffer names in the status line get colored with red except the one that was actually modified:

image

What I would like is to color the active and modified buffer with red (bootstrap in this example), and color the rest with their default highlight.

[Feature request] Add mapping layer.

I feel it's incomplete to this plugin that lacks mapping feature to quick switch between buffers. Do you think?

Like vim-airline's implementation?

powerline fonts

Hello,

I would like to know if it is possible to use powerline fonts when using bufferline ?
I know there is an option for the delimiters, but to be more specific, is there something more automatic that can be done ?

Thank you in advance for any response

Lightline configuration

Hi,

First, I'm new to vim (couple of weeks) but I love it, and I also like your simple plugin.

I'm using lightline for my status bar because I want to keep it light. My lightline config looks like this:

      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'fugitive', 'readonly', 'filename', 'modified' ], ['bufferline'] ]
      \ },
      \ 'component_function': { 'bufferline': 'MyBufferLine' },

On debian, I made it work using the following bufferline function:

let g:bufferline_echo = 0

function! MyBufferLine()
  let st=g:bufferline#refresh_status()
  return g:bufferline_status_info.before . g:bufferline_status_info.current . g:bufferline_status_info.after
endfunction

But on os x it won't recognize the g:bufferline#refresh_status. I did try things from your docs like this:

function! MyBufferLine()
  let st='%{bufferline#refresh_status()}'
  return bufferline#get_status_string()
endfunction

but it returns this to my statusbar:
%#StatusLineNC#%{g:bufferline_status_info.before}%#StatusLine# %{g:bufferline_status_info.current} %#StatusLineNC#%{g:bufferline_status_info.after} |

:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 24 2013 18:58:47)
Compiled by [email protected]
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments -conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic -emacs_tags +eval
+ex_extra +extra_search -farsi +file_in_path +find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn -python3 +quickfix +reltime -rightleft +ruby/dyn
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses

Thanks for helping me out with this!

Bufferline doesn't allow messages and errors to be displayed for enough time

When a message or an error is displayed in the command line, it disappears very shortly after (after a second or less). This means that I'm unable to fully read them if they're more than 3 words long.

I searched for a timeout option to bufferline wait for few more seconds before taking back the command line but to no avail.

BufferLine configurations are not being applied - help required

here is my nvim configurations

I am trying to apply this settings

  let g:bufferline_active_buffer_left = '['
  let g:bufferline_active_buffer_right = ']'

but I have to source the bufferline.vim file everytime for the changes

tried to source manually by adding the following line in packer.lua but didn't work

vim.cmd('source ~/dotfiles/nvim/after/plugin/bufferline.vim')

please help me in fixing this

Add an option to truncate text on left instead of right

When the space in the statusline gets low, the truncation will happen so that the right most characters are visible, but if the let g:bufferline_fixed_index = 0 then you don't get to see the active buffer anymore.

Ideally the truncation would allow to leave the left most sides visible for the longest.

Or alternatively truncate the active buffer as the last resort.

Changing g:bufferline_echo after startup has no effect?

What the title says. Is this intended behaviour? I'm occasionally using the Goyo plugin to hide almost everything in Vim, so I tried to reset the value of g:bufferline_echo when entering Goyo, but it doesn't seem to have any effect.

command line with ruler

Hello, I'm using bufferline in the command line, but i have a problem using it together with set ruler.
When bufferline 'overlaps' the ruler, this happens: scrot
Is there a way to limit the space it occupies or some other workaround?
Thanks.

Keep bufferline persists when scroll using mouse.

I've encountered the issue that when you scroll using mouse bufferline will disappear and will not appear again untill you click on screen and wait for 4s. Any thoughts?

Another one is when I use gg or G bufferline disappears but appears again after 4s.

suppresses the first vim message

Hi bling,
in my case (VIM 8.1) vim-bufferline suppresses the first vim message I get after opening vim. In other words, vim does not display any typical vim message - for example the message search hit BOTTOM, continuing at TOP after searching something with the / command - when vim-bufferline is installed.
When I repeat the same command after that, vim then displays the message as it is supposed to do. I could conclude that vim-bufferline is causing this issue by disabling it temporarily.
Thank you!

Duplicate filenames

If I have multiple buffers open with the same file name, say models from different modules, they all just show up as models.py.

It would be handy to backtrack to the nearest difference in their paths (e.g. foo/../models.py, bar/../models.py) or just show their immediate container in the name.

Screenshot: http://d.pr/i/NF0I

Statusline integration doesn't work for me

I try to implement the status line integration as shown in the help with:

let g:bufferline_echo=0
let &statusline='%{bufferline#refresh_status()}'
let &statusline.=bufferline#get_status_string()

but I always get this error:

E117: Unknown function: bufferline#get_status_string
E15: Invalid expression: bufferline#get_status_string()

I already disabled all other statusline config that I was using ...

PS: This is used together with vim-airline (not sure if that's of any importance).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.