GNU/Linux ◆ screen-256color ◆ zsh 2454 views

Search selected text and apply macro in match

These are the keymaps I used in the demo.

-- Begin search and replace with a macro
vim.keymap.set('x', 'qi', [[y<cmd>let @/=substitute(escape(@", '/'), '\n', '\\n', 'g')<cr>gvqi]])

-- Apply macro in the next instance of the search
vim.keymap.set('n', '<F8>', 'gn@i')

More by vonheikemen

append text 00:14

by vonheikemen

lsp-zero demo 02:08

by vonheikemen

Netrw - move files 00:35

by vonheikemen

replace variable 00:20

by vonheikemen

See all