numToStr/BufOnly.nvim

github github
utility
stars 35
issues 0
subscribers 3
forks 1
CREATED

2020-10-21

UPDATED

3 years ago


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 })