When programmers aren't in vi they edit text with the following:
- ^a - beginning of line
- ^e - end of line
- ^f - forward one character
- ^b - backward one character
- ^n - down one line
- ^p - up one line
- ^d - delete one character forward
- ^h - delete one character backward
- ^w - delete one word backward
- ^k - kill all characters forward on this line
- ^y - put the last thing you killed
^ means the ctrl key, e.g. ^a means "press and hold ctrl, then press a, then release both"
Try them out. These combinations work in nearly every single place you deal with text. If you know of a place that these combinations do not work please let us know below! Or if you know of important keys I've missed here please list those as well.
I thought I'd share a scenario in which I often use several of these combos:
I'm at a command prompt in the middle of typing a command when I realize that I actually need to run a different command first. Now, I can ^c to bring up a fresh prompt, but that loses the command I've already typed. Instead, I would ^a to go to the beginning of the line, ^k to kill the line, I'd then run the command I needed to run first, once that was done I would ^y to put the line I killed before back. At which point I can finish typing the command and run it.
Don't leave home row.
Update 1: This does not work in Gnome.