Situation
- Entire
.vimrc
:
inoremap a <CR>
- Action: user types
ia
to enter insert mode and typea
- Expected result: a carriage return is entered into the document
- Actual result: the characters
<CR>
are typed
I've discovered that a
can be any sequence of characters, and <CR>
can be
any special character denoted with <>
, and this behavior still persists.
I swear it wasn't doing this a few days ago.
Origin
Specifically, I'm trying to include in my .vimrc
:
inoremap {<CR> {<CR>}<Esc>ko
but it did not work.
To debug, I tried
inoremap { {<CR>}<Esc>ko
so Vim did not have to listen for any enter keys.
When Vim typed out {<CR>}<Esc>ko
in my document, I became aware of the nature
of the issue. I believe Vim never activated the initial map because it did not
receive the set of characters <CR>
after the {
.
Netrw also stopped receiving the enter key and Vim just goes to the next line when I intend to select a directory.
About my setup
I'm operating a relatively fresh install of Arch Linux, running off of a bootable USB flash drive. The USB flash drive is plugged into a standard Dell latitude E5510 laptop with Windows 7 on the hard drive, though it is not being used. However, when I use the Windows 7 on the hard drive and use Vim, this problem does not occur. The problem occurs both in the system's console, and in XTerm in i3wm, whether the "VT220 Keyboard" setting is turned on or off, whether "Old Function Keys" is on or off.
:h cpo-<
and:h cpo-k