buffersed.nvim is a small and simple plugin for searching and previewing replacements in a floating window (similar to grep
and sed
).
To install buffersed.nvim, use a package manager such as packer:
use {
"Blackmorse/buffersed.nvim",
requires = { { "Blackmorse/coNVIMient.nvim" } }
}
BufferSearch allows you to search and filter lines without a match, highlighting matched substrings.
BufferSearch.mov
BufferSed displays a floating window showing the difference before and after a replacement, highlighting the difference. After hitting <CR>
, the original buffer content will be replaced (with confirmation).
BufferSed.mov
Here some keymap available:
Ctrl-p,Ctrl-n
: move up and down one lineCtrl-d,Ctl-u
: move up and down half of the screen<Esc><Esc>
orCtrl-C
: quit<CR>
: perform the replacement in the original buffer (with confirmation)<Tab>
: switch between search and replace prompts
Here is an example of all the configuration options:
require("buffersed").setup({
width = 0.8, -- could be a float (relative to the window sized) or integer
height = 0.5, -- the same
custom_position_row = 3, -- floating window row position
custom_position_col = 4, --floating window column position
search_highlight = "guifg=#ff007c gui=bold ctermfg=198 cterm=bold ctermbg=darkblue",
replace_highlight = "guifg=#ff007c gui=bold ctermfg=198 cterm=bold ctermbg=darkyellow"
})