VsVim
VsVim copied to clipboard
Remapped ESC not working in VsVim
I have ESC remapped in VIM to be able to clear search highlights like this:
augroup escape_mapping
autocmd!
autocmd InsertEnter * call s:setupEscapeMap()
augroup END
function! s:setupEscapeMap()
nnoremap <Esc> :noh<CR><Esc>
endfunction
This isn't working with VsVim 2.8.0.0 and VS 16.10.4.
Any chance there's a way to rework this setup to function in VsVim as well?
@Flawe This is the mapping I use in my _vsvimrc
:
nnoremap <esc> :noh<CR><esc>
without wrapping it in a function and it works as expected.
Thanks @gwojan, that does indeed work, but it breaks vanilla Vim, see this thread:
https://vi.stackexchange.com/questions/2614/why-does-this-esc-normal-mode-mapping-affect-startup
I was just curious if there was a way to use a single vimrc for both environments.
@Flawe interesting... I think I might have encountered that a while back and never really put two and two together. That being said, I almost never use vanilla vim
or neovim
.
Thanks for the heads-up -- I'll be watching for this now. 😃