Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/numToStr/BufOnly.nvim

Lua/Neovim port of BufOnly.vim with some changes
https://github.com/numToStr/BufOnly.nvim

lua neovim neovim-plugin nvim plugin vim-plug

Last synced: about 2 months ago
JSON representation

Lua/Neovim port of BufOnly.vim with some changes

Lists

README

        

> 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

- With [packer.nvim](https://github.com/wbthomason/packer.nvim)

```lua
use { "numtostr/BufOnly.nvim", "cmd": "BufOnly" }
```

- With [vim-plug](https://github.com/junegunn/vim-plug)

```vim
Plug 'numtostr/BufOnly.nvim', { 'on': 'BufOnly' }
```

### Usage

```
:BufOnly
```

### Options

- Delete non modifiable buffer like NERD_tree, `false` by default

```lua
vim.g.bufonly_delete_non_modifiable = true
```

### Simple config

```lua
vim.fn.nvim_set_keymap('n', 'x', ':BufOnly', { noremap = true, silent = true })
```