3 ms·
This might be the right audience for this little vimrc tidbit: "Press space to highlight current word nnoremap <silent><space> \ :let @/='\<<C-
by Skunkleton 6y ago
This might be the right audience for this little vimrc tidbit:
"Press space to highlight current word
nnoremap <silent><space>
\ :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>
This works just like *, except that it leaves your cursor where it is. You can then use n/p/whatever as normal.
- lucb1e 6y ago> like * but leaves your cursor where it is Ooooh that is great! I use *# every time and am then annoyed when the n key goes backwards instead of forwards and then I try to remember to do #* instead and pff... ^^ This will solve those issues!
- revscat 6y agoThis is useful enough that I wonder why you chose not to just map it to *. Is there a reason you did not?
- Skunkleton 6y agoBecause <space> is even easier to hit :) Edit: also because I try and keep my keybinds as close to default as I can, and <space> is oddly underused.