Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to map two consecutive Shift in Vim?

Tags:

vim

macvim

Total vim newbie here, is there a way to map two consecutive <Shift> to execute :FZF? I try the following config in .vimrc but no luck

nmap <S><S> :FZF<Enter>  
like image 411
MarkoCen Avatar asked Jun 26 '17 19:06

MarkoCen


1 Answers

Unfortunately you can't atleast not without some serious hacking. To quote from the vim wiki

Note that you cannot map the Shift or Alt or Ctrl keys alone as they are key modifiers. You have to combine these key modifiers with other keys to create a map.

http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-Tutorial(Part_2)

Also i'd recommend you use nnoremap rather than plain nmap, unless you explicitly want your map to be recursive.

On a personal note i use the following mapping for :FZF which is basically a space followed by a 'f' in normal mode. I find it quite nice.

nnoremap <Leader>f :FZF

Happy Vimming.

like image 123
axwr Avatar answered Nov 14 '22 06:11

axwr