Skip to content

ArmanHZ/nvim-select-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-select-buffer

Plugin for NeoVim to display and switch to a buffer. (also my first nvim plugin)

Demo

demo

Key Features

  • Every buffer will get a timestamp when opened
  • Timestamps will be updated when you switch to the buffer
  • Buffers are sorted by their timestamps
  • The switched/current buffer will always be the second on the list. This is because you don't want to switch to the current buffer
  • The previous buffer will be the first. This is for quick access/switch between two frequently used buffers

Installation

Using packer.nvim

-- In packer.lua add
use 'ArmanHZ/nvim-select-buffer'

Setting keybinding to launch the plugin

Create the selectbuffer.lua file in the /after/plugin directory and add the following lines:

-- In /after/plugin/selectbuffer.lua file
local select_buffer = require("select-buffer")
vim.keymap.set("n", "<leader>bb", select_buffer.main)   -- You can use any keybinding you want

Todo

  • (Refactoring) Clean the code and add some color to the display
  • Complete the movement feature and select buffer feature
  • Add help menu below the Buffer text
  • Prepare the directory structure for 'packer' compatibility
  • Add a demo video for the repo
  • Added line highlighting for the buffer window for better visibility
  • Update old api calls to new ones (exec -> exec2)
  • Re-write the buffer order, s.t. latest buffers will be at the top
  • Disable some movement keys while showing the buffer (add unmappings)
  • Update the demo and readme after all these tasks are done