When I open a file with vim, I always start in replace mode.
I figured out, that when I remove this line from my .vimrc, I open files in normal mode again:
nnoremap <esc> :noh<return><esc>
If I exchange <esc>
against a different key combination it also works as expected. I don't understand what is going on here.
Here is my complete .vimrc
. I use termite, in case that could be a problem.
It was some internal problem, what solved the problem was adding this line:
nnoremap <esc>^[ <esc>^[
Here you can find some details about this solution.
This happened to me connecting to a cray from wsl. My .vimrc is pretty much empty; the distro has a default looking vimrc (no special nohl keymapping).
" FIX: ssh from wsl starting with REPLACE mode
" https://stackoverflow.com/a/11940894
if $TERM =~ 'xterm-256color'
set noek
endif
Add this to vimrc and it no longer starts in REPLACE mode.
See https://stackoverflow.com/a/11940894 (same thread Jonas mentioned).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With