numToStr/BufOnly.nvim

github github
utility
star 26
alert-circle 0
users 2
git-branch 1
CREATED

2020-10-21

UPDATED

last year


Lua/Neovim port of https://github.com/vim-scripts/BufOnly.vim with some changes

BufOnly.nvim

Delete all the buffers except the current, not modified and modifiable buffer.

Requirements

  • Neovim 0.5

Install

use { "numtostr/BufOnly.nvim", "cmd": "BufOnly" }
Plug 'numtostr/BufOnly.nvim', { 'on': 'BufOnly' }

Usage

:BufOnly

Options

  • Delete non modifiable buffer like NERD_tree, false by default
vim.g.bufonly_delete_non_modifiable = true

Simple config

vim.fn.nvim_set_keymap('n', '<leader>x', ':BufOnly<CR>', { noremap = true, silent = true })