4 ms·
Another little "trick" for replacing: " search. cw (or cs, c whatever) to replace/fix. esc. n.n.n.n. vnoremap <silent> s //e<C-r>=&selection=='exclusive'?'
by grimgrin 11y ago
Another little "trick" for replacing:
" search. cw (or cs, c whatever) to replace/fix. esc. n.n.n.n.
vnoremap <silent> s //e<C-r>=&selection=='exclusive'?'+1':''<CR><CR>
\:<C-u>call histdel('search',-1)<Bar>let @/=histget('search',-1)<CR>gv
omap s :normal vs<CR>
A really simple, dumb example: http://showterm.io/040c49ac158cdda15fbca http://showterm.io/040c49ac158cdda15fbca
- rav 11y agoCan you explain what the mappings do? I usually use the asterisk to search for the token under the cursor, edit the sought token using cw and then n.n.n.n. to replace later occurrences. I don't see how the mapping makes this more efficient.