Re: Remap <esc> and arrow keys problem

I am using vs2010 and ViEmu, in my _viemurc file, the maps of these keys does not work:

inoremap <C-I> <esc>

inoremap <C-h> <left>
inoremap <C-j> <down>
inoremap <C-k> <up>
inoremap <C-l> <right>

I know it is silly to re bind arrow keys like that and it is not worrying me much.

However remap of <esc> does cause a trouble and currently I can use autohotkey as a workaround.

Any ideas?


Re: Remap <esc> and arrow keys problem


Input management has been changed quite a bit in ViEmu for VS 2010. Since the new editor is WPF based, we cannot intercept the key presses the way we did in older versions. Instead, we create VS commands for each possible key combination but by default we leave most of them not assigned to any key combination, so that we don't mess with most keypress assignments that people or other addins may have configured.
To the point... all you need to do to make those mappings work is go to Tools->Options->Keyboard menu in VS and assign the key combinations to ViEmu commands, for example:

Assign Ctrl+H to command 'ViEmu.KeypressCtrlH'

Also, I would suggest that you choose 'Text Editor' instead of 'Global' in the 'Use new shortcut on' combo. This way the ViEmu command will take precedence over other commands that may have the same key combination assigned.
If this doesn't work, please check that the key combinations are not assigned to other commands that may have higher priority.
I hope this helps...

Best regards,

-- Isaac


Re: Remap <esc> and arrow keys problem

Excellent! Thanks a lot!


Re: Remap <esc> and arrow keys problem

Now I have a new problem:

Say I binded <C-J> to {down} , when I use virtual assist X, on intellisence listbox, if I press <c-J>, cursor would move down one line in code instead of moving down through inteliisence listbox.


Re: Remap <esc> and arrow keys problem

I'm afraid that's not possible, ViEmu mappings are only handled by ViEmu itself, so even after you remap to up/down, it won't reach intellisense or VAX.

As you said, as far as I know you can use AutoHotKey as a workaround and there are people already doing so. Please take a look at this post for more info:



-- Isaac


Re: Remap <esc> and arrow keys problem

I have seen this post before but thanks. My key binding for up and down was alt+ctrl +j/k .The new problem since I installed VAX is whenever I press alt key, intellisence window would go away, if I switch to resharper's intllisence ,then it is fine, but I miss filter by type feature of VAX intellisense.