mrquantumcodes / bufferchad.nvim

A simple yet powerful buffer management system
GNU General Public License v3.0
41 stars 0 forks source link

BufferChad

An simple, customisable Buffer Manager for Neovim that just works out of the box

App Screenshot

*What's new?

*What's New-NEW?

Installation and setup

Install using your favourite package manager. For Example:

Packer ```lua use { "mrquantumcodes/bufferchad.nvim", -- uncomment if you want fuzzy search with telescope and a modern ui -- requires = { -- {"nvim-lua/plenary.nvim"}, -- {"MunifTanjim/nui.nvim"}, -- {"stevearc/dressing.nvim"}, -- {"nvim-telescope/telescope.nvim"} -- needed for fuzzy search, but should work fine even without it -- } } ```
Lazy ```lua { "mrquantumcodes/bufferchad.nvim", -- uncomment if you want fuzzy search with telescope and a modern ui -- dependencies = { -- {"nvim-lua/plenary.nvim"}, -- {"MunifTanjim/nui.nvim"}, -- {"stevearc/dressing.nvim"}, -- {"nvim-telescope/telescope.nvim"} -- needed for fuzzy search, but should work fine even without it -- } } ```

Next, add the following lines to your index.lua:

require("bufferchad").setup({
  mapping = "<leader>bb", -- Map any key, or set to NONE to disable key mapping
  mark_mapping = "<leader>bm", -- The keybinding to display just the marked buffers
  add_mark_mapping = "mset", -- The keybinding to add a mark to a buffer
  order = "LAST_USED_UP", -- LAST_USED_UP (default)/ASCENDING/DESCENDING/REGULAR
  style = "default", -- default, modern (requires dressing.nvim and nui.nvim), telescope (requires telescope.nvim)
  close_mapping = "<Esc><Esc>", -- only for the default style window. 
  normal_editor_mapping = "NONE" -- read use case below
})

Configuration options

Change the mapping to anything you like, I recommend <leader>bb for listing all buffers and <leader>bm for listing marked buffers.

NOTE: The normal_editor_mapping parameter, while optional, is required to be able to edit the indexes of marked buffers. If you want to change your marked buffers, such as reordering them, but you wanna use telescope or modern style for your core ui, then you need to use this parameter, because for now, only the normal style buffer list ui supports editing of it's contents.

The order parameter can have the following arguments:

File Marking

Now, BufferChad allows you to mark files like the Harpoon plugin. This let's you quickly switch between specific files instead of going through a list of all the buffers you have used till now.

Use the add_mark_mapping keymap or the function require('bufferchad').mark_this_buffer() to mark the current file in the last position of the register. Then, to navigate, you can use either of the following options:

Use your mark_mapping (default is <leader>bm) keymap to view your marks list