SlideShare una empresa de Scribd logo
1 de 2
Descargar para leer sin conexión
Readline Emacs Editing Mode Cheat Sheet
Default Keyboard Shortcuts for Bash
Shortcut Function Name Description
Commands for Moving:
C-a beginning-of-line Move to the beginning of line.
C-e end-of-line Move to the end of line.
C-f forward-char Move forward a character.
C-b backward-char Move back a character.
M-f forward-word Move forward a word.
M-b backward-word Move backward a word.
C-l clear-screen Clear the screen leaving the current line at the top of the screen.
(unbound) redraw-current-line Refresh the current line.
Commands for Changing Text:
C-d delete-char Delete one character at point.
Rubout backward-delete-char Delete one character backward.
C-q or C-v quoted-insert Quoted insert.
M-TAB or M-C-i tab-insert Insert a tab character.
a, b, A, 1, !, ... self-insert Insert the character typed.
C-t transpose-chars Exchange the char before cursor with the character at cursor.
M-t transpose-words Exchange the word before cursor with the word at cursor.
M-u upcase-word Uppercase the current (or following) word.
M-l downcase-word Lowercase the current (or following) word.
M-c capitalize-word Capitalize the current (or following) word.
(unbound) overwrite-mode Toggle overwrite mode.
Killing and Yanking:
C-k kill-line Kill the text from point to the end of the line.
C-x Rubout backward-kill-line Kill backward to the beginning of the line.
C-u unix-line-discard Kill backward from point to the beginning of the line.
M-d kill-word Kill from point to the end of the current word.
M-Rubout backward-kill-word Kill the word behind point.
C-w unix-word-rubout Kill the word behind point, using white space as a word boundary.
M- delete-horizontal-space Delete all spaces and tabs around point.
C-y yank Yank the top of the kill ring into the buffer at point.
M-y yank-pop Rotate the kill ring, and yank the new top.
(unbound) kill-whole-line Kill all characters on the current line.
(unbound) kill-region Kill the text between the point and mark.
(unbound) copy-region-as-kill Copy the text in the region to the kill buffer.
(unbound) copy-backward-word Copy the word before point to the kill buffer.
(unbound) copy-forward-word Copy the word following point to the kill buffer.
Keyboard Macros:
C-x ( start-kbd-macro Begin saving the chars typed into the current keyboard macro.
C-x ) end-kbd-macro End saving the chars typed into the current keyboard macro.
C-x e call-last-kbd-macro Re-execute the last keyboard macro defined.
A cheat sheet by Peteris Krumins (peter@catonmat.net), 2007.
http://www.catonmat.net - good coders code, great reuse
Released under GNU Free Document License.
Shortcut Function Name Description
Commands for Manipulating the History:
Return accept-line Accept the line regardless of where the cursor is.
C-p previous-history Fetch the previous command from the history list.
C-n next-history Fetch the next command from the history list.
M-< beginning-of-history Move to the first line in the history.
M-> end-of-history Move to the end of the input history (current line).
C-r reverse-search-history Search backward starting at the current line (incremental).
C-s forward-search-history Search forward starting at the current line (incremental).
M-p non-incremental-reverse-
search-history
Search backward using non-incremental search.
M-n non-incremental-forward-
search-history
Search forward using non-incremental search.
M-C-y yank-nth-arg Insert the n-th argument to the previous command at point.
M-. or M- yank-last-arg Insert the last argument to the previous command.
(unbound) history-search-backward Search forward for a string between start of line and point.
(unbound) history-search-forward Search backward for a string between start of line and point.
Completing:
TAB complete Attempt to perform completion on the text before point.
M-? possible-completions List the possible completions of the text before point.
M-* insert-completions Insert all completions of the text before point generated by
possible-completions.
(unbound) menu-complete Similar to complete but replaces the word with the first match.
(unbound) delete-char-or-list Deletes the car if not at the beginning of line or acts like possible-
completions at the end of the line.
Miscellaneous:
C-x C-r re-read-init-file Read and execute the contents of inputrc file.
C-g abort Abort the current editing command and ring the terminal’s bell.
M-a, M-b, M-x, ... do-uppercase-version If the metafield char x is lowercase, run the command that is
bound to uppercase char.
ESC prefix-meta Metafy the next character typed. For example, ESC-p is equiv-
alent to Meta-p.
C- or C-x C-u undo Incremental undo, separately remembered for each line.
M-r revert-line Undo all changes made to this line.
M-& tilde-expand Perform tilde expansion on the current word.
C-@ or M-<space> set-mark Set the mark to the point.
C-x C-x exchange-point-and-mark Swap the point with the mark.
C-] character-search Move to the next occurance of current character under cursor.
M-C-] character-search-
backward
Move to the previous occurrence of current character under cursor.
M-# insert-comment Without argument line is commented, with argument uncom-
mented (if it was commented).
C-e emacs-editing-mode When in vi mode, switch to emacs mode.
M-C-j vi-editing-mode When in emacs mode, switch to vi mode.
M-0, M-1, ..., M– digit-argument Specify the digit to the argument. M– starts a negative argument.
(unbound) dump-functions Print all of the functions and their key bindings.
(unbound) dump-variables Print all of the settable variables and their values.
(unbound) dump-macros Print all of the key sequences bound to macros.
(unbound) universal-argument Either sets argument or multiplies the current argument by 4.
A cheat sheet by Peteris Krumins (peter@catonmat.net), 2007.
http://www.catonmat.net - good coders code, great reuse

Más contenido relacionado

Más de King Hom

人体24小时器官工作表
人体24小时器官工作表人体24小时器官工作表
人体24小时器官工作表King Hom
 
VIM学习笔记8 选择模式
VIM学习笔记8 选择模式VIM学习笔记8 选择模式
VIM学习笔记8 选择模式King Hom
 
手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)King Hom
 
VIM学习笔记2 移动和修改命令
VIM学习笔记2 移动和修改命令VIM学习笔记2 移动和修改命令
VIM学习笔记2 移动和修改命令King Hom
 
VIM学习笔记3 复制和粘贴命令
VIM学习笔记3 复制和粘贴命令VIM学习笔记3 复制和粘贴命令
VIM学习笔记3 复制和粘贴命令King Hom
 
VIM学习笔记6 使用多标签页
VIM学习笔记6 使用多标签页VIM学习笔记6 使用多标签页
VIM学习笔记6 使用多标签页King Hom
 
Linux 新手入门
Linux 新手入门Linux 新手入门
Linux 新手入门King Hom
 
安装 Subversion
安装 Subversion安装 Subversion
安装 SubversionKing Hom
 
Effective_Vim
Effective_VimEffective_Vim
Effective_VimKing Hom
 
VIM学习笔记1 基本编辑命令
VIM学习笔记1 基本编辑命令VIM学习笔记1 基本编辑命令
VIM学习笔记1 基本编辑命令King Hom
 
VIM学习笔记4 查找文本
VIM学习笔记4 查找文本VIM学习笔记4 查找文本
VIM学习笔记4 查找文本King Hom
 
VIM学习笔记7 可视化模式
VIM学习笔记7 可视化模式VIM学习笔记7 可视化模式
VIM学习笔记7 可视化模式King Hom
 
vim用户手册中文版
vim用户手册中文版vim用户手册中文版
vim用户手册中文版King Hom
 
高效率编辑器 VIM-操作篇
高效率编辑器 VIM-操作篇高效率编辑器 VIM-操作篇
高效率编辑器 VIM-操作篇King Hom
 
设置用vim编辑python
设置用vim编辑python设置用vim编辑python
设置用vim编辑pythonKing Hom
 

Más de King Hom (15)

人体24小时器官工作表
人体24小时器官工作表人体24小时器官工作表
人体24小时器官工作表
 
VIM学习笔记8 选择模式
VIM学习笔记8 选择模式VIM学习笔记8 选择模式
VIM学习笔记8 选择模式
 
手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)
 
VIM学习笔记2 移动和修改命令
VIM学习笔记2 移动和修改命令VIM学习笔记2 移动和修改命令
VIM学习笔记2 移动和修改命令
 
VIM学习笔记3 复制和粘贴命令
VIM学习笔记3 复制和粘贴命令VIM学习笔记3 复制和粘贴命令
VIM学习笔记3 复制和粘贴命令
 
VIM学习笔记6 使用多标签页
VIM学习笔记6 使用多标签页VIM学习笔记6 使用多标签页
VIM学习笔记6 使用多标签页
 
Linux 新手入门
Linux 新手入门Linux 新手入门
Linux 新手入门
 
安装 Subversion
安装 Subversion安装 Subversion
安装 Subversion
 
Effective_Vim
Effective_VimEffective_Vim
Effective_Vim
 
VIM学习笔记1 基本编辑命令
VIM学习笔记1 基本编辑命令VIM学习笔记1 基本编辑命令
VIM学习笔记1 基本编辑命令
 
VIM学习笔记4 查找文本
VIM学习笔记4 查找文本VIM学习笔记4 查找文本
VIM学习笔记4 查找文本
 
VIM学习笔记7 可视化模式
VIM学习笔记7 可视化模式VIM学习笔记7 可视化模式
VIM学习笔记7 可视化模式
 
vim用户手册中文版
vim用户手册中文版vim用户手册中文版
vim用户手册中文版
 
高效率编辑器 VIM-操作篇
高效率编辑器 VIM-操作篇高效率编辑器 VIM-操作篇
高效率编辑器 VIM-操作篇
 
设置用vim编辑python
设置用vim编辑python设置用vim编辑python
设置用vim编辑python
 

Readline emacs-editing-mode-cheat-sheet

  • 1. Readline Emacs Editing Mode Cheat Sheet Default Keyboard Shortcuts for Bash Shortcut Function Name Description Commands for Moving: C-a beginning-of-line Move to the beginning of line. C-e end-of-line Move to the end of line. C-f forward-char Move forward a character. C-b backward-char Move back a character. M-f forward-word Move forward a word. M-b backward-word Move backward a word. C-l clear-screen Clear the screen leaving the current line at the top of the screen. (unbound) redraw-current-line Refresh the current line. Commands for Changing Text: C-d delete-char Delete one character at point. Rubout backward-delete-char Delete one character backward. C-q or C-v quoted-insert Quoted insert. M-TAB or M-C-i tab-insert Insert a tab character. a, b, A, 1, !, ... self-insert Insert the character typed. C-t transpose-chars Exchange the char before cursor with the character at cursor. M-t transpose-words Exchange the word before cursor with the word at cursor. M-u upcase-word Uppercase the current (or following) word. M-l downcase-word Lowercase the current (or following) word. M-c capitalize-word Capitalize the current (or following) word. (unbound) overwrite-mode Toggle overwrite mode. Killing and Yanking: C-k kill-line Kill the text from point to the end of the line. C-x Rubout backward-kill-line Kill backward to the beginning of the line. C-u unix-line-discard Kill backward from point to the beginning of the line. M-d kill-word Kill from point to the end of the current word. M-Rubout backward-kill-word Kill the word behind point. C-w unix-word-rubout Kill the word behind point, using white space as a word boundary. M- delete-horizontal-space Delete all spaces and tabs around point. C-y yank Yank the top of the kill ring into the buffer at point. M-y yank-pop Rotate the kill ring, and yank the new top. (unbound) kill-whole-line Kill all characters on the current line. (unbound) kill-region Kill the text between the point and mark. (unbound) copy-region-as-kill Copy the text in the region to the kill buffer. (unbound) copy-backward-word Copy the word before point to the kill buffer. (unbound) copy-forward-word Copy the word following point to the kill buffer. Keyboard Macros: C-x ( start-kbd-macro Begin saving the chars typed into the current keyboard macro. C-x ) end-kbd-macro End saving the chars typed into the current keyboard macro. C-x e call-last-kbd-macro Re-execute the last keyboard macro defined. A cheat sheet by Peteris Krumins (peter@catonmat.net), 2007. http://www.catonmat.net - good coders code, great reuse Released under GNU Free Document License.
  • 2. Shortcut Function Name Description Commands for Manipulating the History: Return accept-line Accept the line regardless of where the cursor is. C-p previous-history Fetch the previous command from the history list. C-n next-history Fetch the next command from the history list. M-< beginning-of-history Move to the first line in the history. M-> end-of-history Move to the end of the input history (current line). C-r reverse-search-history Search backward starting at the current line (incremental). C-s forward-search-history Search forward starting at the current line (incremental). M-p non-incremental-reverse- search-history Search backward using non-incremental search. M-n non-incremental-forward- search-history Search forward using non-incremental search. M-C-y yank-nth-arg Insert the n-th argument to the previous command at point. M-. or M- yank-last-arg Insert the last argument to the previous command. (unbound) history-search-backward Search forward for a string between start of line and point. (unbound) history-search-forward Search backward for a string between start of line and point. Completing: TAB complete Attempt to perform completion on the text before point. M-? possible-completions List the possible completions of the text before point. M-* insert-completions Insert all completions of the text before point generated by possible-completions. (unbound) menu-complete Similar to complete but replaces the word with the first match. (unbound) delete-char-or-list Deletes the car if not at the beginning of line or acts like possible- completions at the end of the line. Miscellaneous: C-x C-r re-read-init-file Read and execute the contents of inputrc file. C-g abort Abort the current editing command and ring the terminal’s bell. M-a, M-b, M-x, ... do-uppercase-version If the metafield char x is lowercase, run the command that is bound to uppercase char. ESC prefix-meta Metafy the next character typed. For example, ESC-p is equiv- alent to Meta-p. C- or C-x C-u undo Incremental undo, separately remembered for each line. M-r revert-line Undo all changes made to this line. M-& tilde-expand Perform tilde expansion on the current word. C-@ or M-<space> set-mark Set the mark to the point. C-x C-x exchange-point-and-mark Swap the point with the mark. C-] character-search Move to the next occurance of current character under cursor. M-C-] character-search- backward Move to the previous occurrence of current character under cursor. M-# insert-comment Without argument line is commented, with argument uncom- mented (if it was commented). C-e emacs-editing-mode When in vi mode, switch to emacs mode. M-C-j vi-editing-mode When in emacs mode, switch to vi mode. M-0, M-1, ..., M– digit-argument Specify the digit to the argument. M– starts a negative argument. (unbound) dump-functions Print all of the functions and their key bindings. (unbound) dump-variables Print all of the settable variables and their values. (unbound) dump-macros Print all of the key sequences bound to macros. (unbound) universal-argument Either sets argument or multiplies the current argument by 4. A cheat sheet by Peteris Krumins (peter@catonmat.net), 2007. http://www.catonmat.net - good coders code, great reuse