My Vim (8.0) has started launching in command mode with the value :2R
.
I keep my vimrc in a git repo, so I checked out previous commits until I got to a point where the weird behaviour stopped. The git diff between the last functioning commit and the first one with the error is simply:
diff --git a/.vim/common.vim b/.vim/common.vim
index a5b2443..bb209c3 100644
--- a/.vim/common.vim
+++ b/.vim/common.vim
@@ -13,27 +13,28 @@ noremap ( zz
nnoremap Y y$
" Find my way around inside text objects
-map [[ "_yaB
-map ]] "_yaB%
-map [b "_yab
-map ]b "_yab%
-map [d "_ya]
-map ]d "_ya]%
+noremap [[ "_yaB
+noremap ]] "_yaB%
+noremap [b "_yab
+noremap ]b "_yab%
+noremap [d "_ya]
+noremap ]d "_ya]%
-map [s (
-map }s )
+noremap [s (
+noremap ]s )
" Various C-macros
-nmap <C-n> nzz
-nmap <C-a> W50i <Esc>B50ldwBj
-nmap <C-u> ElldwBj
-nmap <C-f> }?function<Enter>{jVN/{<Enter>%
+nnoremap <C-n> nzz
+nnoremap <C-a> W50i <Esc>B50ldwBj
+nnoremap <C-u> ElldwBj
+nnoremap <C-f> }?function<Enter>{jVN/{<Enter>%
nnoremap <C-c> mwA;<Esc>`w
nnoremap <C-o> mwO<Esc>0Dj`w
nnoremap <C-.> mwo<Esc>0Dk`w
" Give it back
-nnoremap <C-p> <C-o>
+nnoremap <C-[> <C-o>
+nnoremap <C-]> <C-p>
" for search highlighting
set hlsearch
How on earth would this change cause this behaviour?
Related: Strange symbol in vim command line after start suggests it's a misconfigured TERM
environment variable, but I certainly didn't change that manually and comparing the output of env
for the two commits shows no difference.
Edit: I traced it back to the line
nnoremap <C-[> <C-o>
This must be a problem because I'm remapping the escape key. I'm embarrassed I didn't think about that.
I still wonder how that could possibly manifest in the behaviour I saw, so any explanations would be welcome.