Problems with vi Commands
When you type commands, text jumps around on the screen and nothing works the way it’s supposed to.
Make sure you’re not typing the
Jcommand when you meanj.You may have hit the CAPS LOCK key without noticing it. vi is case-sensitive; that is, uppercase commands (
I,A,J, etc.) are different from lowercase commands (i,a,j), so all your commands are being interpreted not as lowercase but as uppercase commands. Press the CAPS LOCK key again to return to lowercase, press ESC to ensure that you are in command mode, then type eitherUto restore the last line changed oruto undo the last command. You’ll probably also have to do some additional editing to fully restore the garbled part of your file.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access