Dup Goto 📝

VimTips_01

PT2/editor/vim 06-30 15:31:50
To Pop
19 lines, 85 words, 480 chars Monday 2025-06-30 15:31:50

Saving Macros

let @q = 'macro contents'

Use "qp to paste contents of register, which is where the macro is stored.

Silent Write Visual Selected Lines

:silent! '<,'> w !command

If you want to use this in a nmap there is an issue: the : puts the cursor after the :'<,'>:. The solution is this:

:vnoremap <silent> \c :w !cmd<cr><esc>

or something like this to silently write the current line

:nnoremap <silent> \c V:w !cmd<cr><esc>