professional documents
home
Profile
docsters
request
Blogs
Upload
about me
contact me
user photo
Peteris Krumins
chief hacker
catonmat
i love mathematics, physics and computer science!
submit clear
Readline VI Editing Mode Cheat Sheet Default Keyboard Shortcuts for Bash Shortcut Description Switching to Command Mode: ESC Switch to command mode. Commands for Entering Input mode: i Insert before cursor. a Insert after cursor. I Insert at the beginning of line. A Insert at the end of line. c Change text of a movement command (see below). C Change text to the end of line (equivalent to c$). cc or S Change current line (equivalent to 0c$). s Delete a single character under the cursor and enter input mode (equivalent to c[SPACE]) . r Replaces a single character under the cursor (without leaving command mode). R Replaces characters under the cursor. v Edit (and execute) the current command in a text editor (an editor in $VISUAL and $EDITOR variables or vi). Basic Movement Commands (in command mode): l or SPACE Move one character right. h Move one character left. w Move one word or token right. b Move one word or token left. W Move one non-blank word right. B Move one non-blank word left. e Move to the end of the current word. E Move to the end of the current non-blank word. 0 Move to the beginning of line. ^ Move to the rst non-blank character of line. $ Move to the end of line. % Move to the corresponding opening/closing bracket (()'s, []'s and fg's). Character Finding Commands (these are also Movement Commands): fc Move right to the next occurance of c. Fc Move left to the previous occurance of c. tc Move right to the next occurance of c, then one char backward. Tc Move left to the previous occurance of c, then one char forward. ; Redo the last character nding command. , Redo the last character nding command in opposite direction. j Move to the n-th column (you may specify the argument n by typing it on number keys, for example, 20j). A cheat sheet by Peteris Krumins (peter@catonmat.net), 2008. http://www.catonmat.net - good coders code, great reuse Released under GNU Free Document License.Deletion Commands: x Delete a single character under the cursor. X Delete a character before the cursor. d Delete text of a movement command (see above). D Delete to the end of the line (equivalent to d$). dd Delete current line (equivalent to 0d$). CTRL-w Delete the previous word. CTRL-u Delete from the cursor to the beginning of line. Undo, Redo and Copy/Paste Commands: u Undo previous text modication. U Undo all previous text modications on the line. . Redo the last text modication. y Yank a movement into buer (copy). yy Yank the whole line. p Insert the yanked text at the cursor (paste). P Insert the yanked text before the cursor. Commands for Command History: k Move backward one command in history. j Move forward one command in history. G Move to the history line n (you may specify the argument n by typing it on number keys, for example, 15G). /string or CTRL-r Search history backward for a command matching string. ?string or CTRL-s Search history forward for a command matching string (remember that on most machines CTRL-s stops the output to the terminal (CTRL-q starts output) and you might need to change it with stty command). n Repeat search in the same direction as previous. N Repeat search in the opposite direction as previous. Completion Commands: TAB or CTRL-i or = List possible completions. * Insert all possible completions. Miscellaneous Commands: Invert the case of the character under cursor, and move a character right. # Prepend # (comment character) to the line and send it to the history list. Inserts the n-th word of the previous command in the current line. 0, 1, 2, ... Sets the numeric argument. CTRL-v Insert a character literally (quoted insert). CTRL-t Transpose (exchange) two characters. Examples and Tips Some of the commands take a . These commands apply the movement to themselves. For example, d$ would use $ as a movement, which moves the cursor to the end of the line, thus, the whole d$ would delete text from the current cursor position to the end of the line. Another example, a command cfA would use fA as a movement, which nds the next occurance of the character A, thus, the whole command would change the line up to character A. Use CTRL-v to insert character literally, for example, CTRL-v CTRL-r would insert CTRL-r in the command line. See man bash, man readline, and built in bind command for modifying the default behavior! A cheat sheet by Peteris Krumins (peter@catonmat.net), 2008. http://www.catonmat.net - good coders code, great reuse Released under GNU Free Document License.
rate this doc
email this doc
embed this doc
add to folder
digg reddit stumble delicious
flag this doc
5126
55
7(3)
1
1/10/2008
English
search termpage on Googletimes searched
Preview

Bash Emacs Editing Mode (readline) Cheat Sheet

pkrumins 1/10/2008 | 307 | 13 | 0 | technology
Preview

Screen VT100ANSI Terminal Emulator Cheat Sheet

pkrumins 1/10/2008 | 330 | 10 | 0 | technology
Preview

Sed, UNIX Stream Editor, Cheat Sheet

pkrumins 1/10/2008 | 423 | 31 | 0 | technology
Preview

Ed, The Original UNIX Text Editor, Cheat Sheet

pkrumins 1/10/2008 | 265 | 20 | 0 | technology
Preview

unix command cheat sheet

anonymous 4/4/2008 | 294 | 41 | 0 | technology
Preview

Perl Predefined Variables (Special Variable) Cheat Sheet

pkrumins 1/10/2008 | 317 | 26 | 0 | technology
Preview

unix command cheat sheet[1]

anonymous 4/4/2008 | 335 | 21 | 0 | technology
Preview

Bash History Cheat Sheet

anonymous 4/11/2008 | 197 | 3 | 1 | educational
Preview

Second Life Keyboard Shortcuts Cheat Sheet

anonymous 4/4/2008 | 159 | 13 | 0 | technology
Preview

Second Life Keyboard Shortcuts Cheat Sheet[1]

anonymous 4/4/2008 | 344 | 14 | 0 | technology
Preview

Cooking on a Grill Cheet Sheet

dice1976 11/2/2007 | 602 | 28 | 1 | creative
Preview

Unix Cheet Sheet

dice1976 11/1/2007 | 805 | 123 | 0 | technology
Preview

Bash Shell History Editing Cheat Sheet

pkrumins 2/18/2008 | 569 | 7 | 0 | technology
Preview

PHP PCRE Cheat Sheet

anonymous 4/4/2008 | 173 | 15 | 0 | technology
Preview

Bash Shell History Editing Cheat Sheet

pkrumins 2/18/2008 | 569 | 7 | 1 | technology
Preview

Perl Pack Unpack Printf Sprintf Cheat Sheet Summary

pkrumins 1/10/2008 | 1283 | 12 | 0 | technology
Preview

Perl Predefined Variables (Special Variable) Cheat Sheet

pkrumins 1/10/2008 | 317 | 26 | 1 | technology
Preview

Sed, UNIX Stream Editor, Cheat Sheet

pkrumins 1/10/2008 | 423 | 31 | 1 | technology
Preview

Ed, The Original UNIX Text Editor, Cheat Sheet

pkrumins 1/10/2008 | 265 | 20 | 1 | technology
Preview

AWK (Aho, Kernighan, and Weinberger), NAWK and GAWK Programming Language Cheat Sheet Summary

pkrumins 1/10/2008 | 339 | 16 | 0 | technology
Preview

Bash Emacs Editing Mode (readline) Cheat Sheet

pkrumins 1/10/2008 | 307 | 13 | 0 | technology
Preview

Screen VT100ANSI Terminal Emulator Cheat Sheet

pkrumins 1/10/2008 | 330 | 10 | 1 | technology
bash cheat sheet119
bash vi17
readline cheat sheet16
bash cheatsheet16
cheat13
bash set -o vi13
shell vi mode cheat sheet13
vi cheatsheet23
read line bash12
linux bash vi12
linux bash editor12
linux bash copy paste text12
linux vi bash12
linux string paste end of line12
bash redo12
linux bash comments12
linux unix cheatsheets72
linux vi cheat sheet12
bash vi editing mode12
bash vi search12
 
review this doc
Bash VI Editing Mode (readline) Cheat Sheet
Rated 9 out of 10

April 09, 2008 (4 months 11 days ago)Pretty good collection!!! Might have taken a good amount of hands on to comprise all this. Many of them were known things but coders don’t bother to use them. A very helpful guide for coders. My take out from this list is CTRL-w and CTRL-u commands. I didn’t have even a vague idea about their existence. Good work!!!