All Projects → mhinz → Vim Sayonara

mhinz / Vim Sayonara

Licence: mit
👺 Sane buffer/window deletion.

Projects that are alternatives of or similar to Vim Sayonara

Neovim Fuzzy
Fuzzy file finding for neovim
Stars: ✭ 103 (-52.97%)
Mutual labels:  neovim, vim-plugin
Iris.vim
📫 Simple mail client for Vim.
Stars: ✭ 148 (-32.42%)
Mutual labels:  neovim, vim-plugin
Nvim Treesitter Context
Show code context
Stars: ✭ 113 (-48.4%)
Mutual labels:  neovim, vim-plugin
Asyncrun.vim
🚀 Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
Stars: ✭ 1,332 (+508.22%)
Mutual labels:  neovim, vim-plugin
Vim Janah
Vim colorscheme.
Stars: ✭ 172 (-21.46%)
Mutual labels:  neovim, vim-plugin
Vim current word
Plugin highlighting word under cursor and all of its occurences
Stars: ✭ 100 (-54.34%)
Mutual labels:  neovim, vim-plugin
Vem Tabline
A lightweight Vim/Neovim plugin to display buffers and tabs in the tabline
Stars: ✭ 129 (-41.1%)
Mutual labels:  neovim, vim-plugin
Vista.vim
🌵 Viewer & Finder for LSP symbols and tags
Stars: ✭ 1,218 (+456.16%)
Mutual labels:  neovim, vim-plugin
Neotex
latex live preview - plugin for neovim and vim 8
Stars: ✭ 170 (-22.37%)
Mutual labels:  neovim, vim-plugin
Vim Dadbod Completion
Database autocompletion powered by https://github.com/tpope/vim-dadbod
Stars: ✭ 163 (-25.57%)
Mutual labels:  neovim, vim-plugin
Vim Which Key
🌷 Vim plugin that shows keybindings in popup
Stars: ✭ 1,310 (+498.17%)
Mutual labels:  neovim, vim-plugin
Visual Split.vim
Vim plugin to control splits with visual selections or text objects
Stars: ✭ 190 (-13.24%)
Mutual labels:  neovim, vim-plugin
Vim Rfc
📓 Query RFC database and download RFCs from within Vim.
Stars: ✭ 88 (-59.82%)
Mutual labels:  neovim, vim-plugin
Ncm R
R autocompletion for Neovim and vim 8 📝 📊 ⚡️
Stars: ✭ 102 (-53.42%)
Mutual labels:  neovim, vim-plugin
Todoist.nvim
A todoist extension for neovim
Stars: ✭ 84 (-61.64%)
Mutual labels:  neovim, vim-plugin
Vim Clap
👏 Modern performant fuzzy picker for Vim and NeoVim
Stars: ✭ 1,802 (+722.83%)
Mutual labels:  neovim, vim-plugin
Vim Grepper
👾 Helps you win at grep.
Stars: ✭ 1,030 (+370.32%)
Mutual labels:  neovim, vim-plugin
Vim Lookup
Jump to the definition of variables or functions in VimL code.
Stars: ✭ 51 (-76.71%)
Mutual labels:  neovim, vim-plugin
Targets.vim
Vim plugin that provides additional text objects
Stars: ✭ 2,114 (+865.3%)
Mutual labels:  neovim, vim-plugin
Animate.vim
A Vim Window Animation Library
Stars: ✭ 173 (-21%)
Mutual labels:  neovim, vim-plugin

vim-sayonara

This plugin provides a single command that deletes the current buffer and handles the current window in a smart way.

Basically you don't have to think in terms of :bdelete, :close, :quit etc. anymore. The plugin does that for you.

It reduces cognitive load and lets you focus on the main task: editing text.

:Sayonara

This deletes the current buffer and closes the current window.

:Sayonara!

This deletes the current buffer and preserves the current window.

Installation and Documentation

Use your favorite plugin manager, e.g. vim-plug:

Plug 'mhinz/vim-sayonara', { 'on': 'Sayonara' }

Read :h sayonara for more information about this plugin.

Details

First of all, :Sayonara or :Sayonara! will only delete the buffer, if it isn't shown in any other window. Otherwise :bdelete would close these windows as well. Therefore both commands always only affect the current window. This is what the user expects and is easy reason about.

If the buffer contains unsaved changes, you'll be prompted on what to do.

:Sayonara

* mark current buffer
* current window is the only window in current tabpage?
  true  => is there only one tabpage?
           true  => are there any other active buffers?
                    true  => switch to most recently used active buffer
                    false => Is g:sayonara_confirm_quit set?
                             true  => confirm whether to quit Vim
                             false => quit Vim
           false => close tabpage
  false => close window
* delete marked buffer unless it is shown in any other window

:Sayonara!

* mark current buffer
* are there any other active buffers?
  true  => switch to most recently used active buffer
  false => create an empty scratch buffer
* delete marked buffer unless it is shown in any other window

If a window with an associated location-list is closed, the location list will be closed as well.

Isn't this the same as bufkill?

No.

The biggest difference is that bufkill doesn't handle other windows and tabpages at all, so if you try to delete a buffer that is also shown in another window, multiple windows will be closed. Sayonara is more predictable in this regard, and, if at all, only closes the current window.

Bufkill also doesn't handle associated location lists.

Sayonara simply handles more corner cases and tries to make one command always Do The Right Thing whereas bufkill provides multiple commands so you always have to think about what you're trying to do.

Feedback

If you like this plugin, star it! It's a great way of getting feedback. The same goes for reporting issues or feature requests.

Contact: Twitter

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].