/Nvim-Switch-Buffer

A Neovim plugin using the floating window api to switch buffer

Primary LanguageVim ScriptMIT LicenseMIT

Nvim-Switch-Buffer

Nvim-Switch-Buffer is a plugin to quickly switch between open buffers in neovim.
It uses the floating window feature of neovim

Example:
alt text

Disclaimer

This project is stable and functional but it was mainly made to experiment vimscript and neovim API.
I used it for a while but then i discovered the :Window command of FZF vim that I find much better and pleasant to use.
Even if I don't use it I'll still maintain this project, if you're facing a bug just open an issue on Github.

Installation

Using Plug

Plug 'Yohannfra/Nvim-Switch-Buffer'

Manual installation

git clone https://github.com/Yohannfra/Nvim-Switch-Buffer/ ~/.vim/plugin/

Configuration

Just add these lines to your init.vim

" Feel free to map the shortcut you want
nnoremap S :SwitchBuffer <cr>

set switchbuf=usetab

You can also hide the buffer numbers with

let g:switch_buffer_hide_numbers = 1

How to use

  • Navigate in the window using j/k or Up/Down
  • Press Enter or Space to open the buffer
  • Press s to open the buffer in a horizontal split
  • Press v to open the buffer in a vertical split
  • Press t to open the buffer in a new tab
  • Press dd to close a buffer (you can't close the current buffer)
  • Press S or :q to close the window

License

This project is licensed under the terms of the MIT license.