Vim Arrow Keys Insert A B C D
Workaround available Linux, SSH, WSL Updated October 21, 2026
Quick answer
Vim is running in vi-compatible mode or with the wrong TERM. Add set nocompatible to your vimrc (or install full Vim) and check $TERM.
Most likely fix: Create a vimrc with nocompatible.
Symptoms
Pressing arrow keys in Insert mode inserts new lines with A, B, C or D instead of moving the cursor; common over SSH or on minimal installs.
Why it happens
- No vimrc loaded, so Vim runs in vi-compatible mode
- Minimal vim-tiny build installed (Debian/Ubuntu)
- Wrong $TERM value in SSH or VM sessions
How to fix it
Try these in order — the most common fix is first.
1. Create a vimrc with nocompatible
- Add set nocompatible to ~/.vimrc (an empty ~/.vimrc also turns compatible mode off)
- Restart Vim
2. Install the full Vim package
- Debian/Ubuntu: sudo apt install vim
- Check vim --version to confirm 'Huge' or 'Normal' version
3. Fix the terminal type
- echo $TERM
- Try export TERM=xterm-256color and reopen Vim
4. Check the global vimrc
- vim --version shows the system vimrc path
- Make sure that file exists and isn't setting compatible
This guide also covers
- vim arrow keys abcd
- vim arrow keys not working insert mode
- vi arrow keys print letters
Still not working?
If Vim keeps failing, you're not alone. See every Vim problem users report or the alternatives people switch to.
Other Vim errors
- How to Exit Vim (Stuck in Vim)
- Vim Copy to Clipboard Not Working
- Vim E325: ATTENTION Found a Swap File
- Vim E212: Can't Open File for Writing
- Vim E37: No Write Since Last Change
- Vim Backspace Not Working in Insert Mode
- Vim Paste Indentation Messed Up (Staircase Effect)
- Vim Colors Wrong in tmux
- Why Is Vim So Slow? (Large Files & Long Lines)
- Vim Requires Python 3 Support Error (YouCompleteMe)
- Vim Modeline Vulnerability CVE-2026-34982