문제

I am trying to remap the * operator in VIM. I have tried nnoremap <*> and nnoremap <S-8> to no avail. I haven't been able to find any instructions on how to properly do this. How can I remap my *, or any number keys/number key special characters?

Since many of you will no doubt wonder why anyone would want to do this, it's so I can make my * operator behave like normal, except not advance automatically to the next occurrence of the word under cursor (see under section Highlight Matches Without Moving).

EDIT:

The complete command I'm working with is this:

nnoremap <*> :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>

Where * remaps the functionality of * or <shift + 8>

도움이 되었습니까?

해결책

Getting rid of the < and > works for me.

nnoremap * :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>

다른 팁

Try nnoremap <F7> <*>. It will remap the * with F7

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top