|
| 1 | +# Bufferinator.nvim |
| 2 | + |
| 3 | +> Epic, humorous, and modern buffer management plugin for Neovim — nuke, blast, or yeet your buffers with style! |
| 4 | +
|
| 5 | +--- |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- 🧨 Dynamic floating menu with border for buffer actions |
| 10 | +- 🚀 Close hidden buffers, current buffer, all except current, or all buffers |
| 11 | +- 🎛️ Easily overridable keymap and options (default: `<C-q>`) |
| 12 | +- 🧩 Optionally disable built-in keymaps and use only the `:BufferinatorMenu` command |
| 13 | +- 📝 LuaDoc-style API documentation & Neovim help file (`:help bufferinator`) |
| 14 | +- 🧪 Automated tests with plenary.nvim |
| 15 | +- 🪶 No runtime plugin dependencies (except for tests) |
| 16 | +- ⚖️ MIT License |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +**With [lazy.nvim](https://github.com/folke/lazy.nvim):** |
| 23 | +```lua |
| 24 | +{ |
| 25 | + "yourname/bufferinator.nvim", |
| 26 | + config = function() |
| 27 | + require("bufferinator").setup({ |
| 28 | + -- Default keymap to open the menu (normal mode) |
| 29 | + keymap = "<C-q>", |
| 30 | + |
| 31 | + -- Set to true to disable built-in keymaps |
| 32 | + disable_keymaps = false, |
| 33 | + }) |
| 34 | + |
| 35 | + -- Example: set your own keymap to open the menu via the command |
| 36 | + -- vim.keymap.set("n", "<leader>bm", function() vim.cmd("BufferinatorMenu") end) |
| 37 | + end |
| 38 | +} |
| 39 | +``` |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## Configuration & Usage |
| 44 | + |
| 45 | +```lua |
| 46 | +require("bufferinator").setup({ |
| 47 | + -- Default keymap to open the menu (normal mode) |
| 48 | + keymap = "<C-q>", |
| 49 | + |
| 50 | + -- Set to true to disable built-in keymaps |
| 51 | + -- Only use the :BufferinatorMenu command or your own keymap |
| 52 | + disable_keymaps = false, |
| 53 | +}) |
| 54 | + |
| 55 | +-- Example: set your own keymap to open the menu via the command |
| 56 | +-- vim.keymap.set("n", "<leader>bm", function() vim.cmd("BufferinatorMenu") end) |
| 57 | +``` |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## Menu Options |
| 62 | + |
| 63 | +1. Cancel the action |
| 64 | +2. Close hidden buffers |
| 65 | +3. Close current buffer |
| 66 | +4. Close all buffers except current |
| 67 | +5. Close all buffers (including current) |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +## Commands |
| 72 | + |
| 73 | +- `:BufferinatorMenu` — Open the Bufferinator floating menu |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## API |
| 78 | + |
| 79 | +```lua |
| 80 | +--- Setup Bufferinator.nvim |
| 81 | +-- @param opts table|nil Optional table of options: |
| 82 | +-- - keymap (string): Keymap to open the menu (default: "<C-q>") |
| 83 | +-- - disable_keymaps (boolean): If true, built-in keymaps are not set |
| 84 | +require("bufferinator").setup({ |
| 85 | + keymap = "<leader>bb", |
| 86 | + disable_keymaps = false, |
| 87 | +}) |
| 88 | +``` |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## Documentation |
| 93 | + |
| 94 | +- `:help bufferinator` for full help and usage details. |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## Testing |
| 99 | + |
| 100 | +- Requires [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) for tests. |
| 101 | +- Run tests in Neovim: |
| 102 | + ``` |
| 103 | + :PlenaryBustedDirectory tests/ |
| 104 | + ``` |
| 105 | +- Or in terminal: |
| 106 | + ``` |
| 107 | + nvim --headless -c "PlenaryBustedDirectory tests/" +qall |
| 108 | + ``` |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## License |
| 113 | + |
| 114 | +MIT |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +## Epicness |
| 119 | + |
| 120 | +Bufferinator.nvim is here to nuke, blast, and yeet your buffers with style. |
| 121 | +Feel free to open issues, PRs, or memes! |
0 commit comments