GNU/Linux • screen-256color • zsh 3090 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 recordings by vonheikemen

Browse all

replace variable 0:20

by vonheikemen

lsp-zero demo 2:08

by vonheikemen

append text 0:14

by vonheikemen