![哪些 emacs 快捷方式在 bash 中有用?](https://linux22.com/image/1294255/%E5%93%AA%E4%BA%9B%20emacs%20%E5%BF%AB%E6%8D%B7%E6%96%B9%E5%BC%8F%E5%9C%A8%20bash%20%E4%B8%AD%E6%9C%89%E7%94%A8%EF%BC%9F.png)
除此之外Ctrl+{k, u, a, e}
,还有哪些 emacs 快捷方式值得记住并且在终端中有用?
答案1
很难说哪些快捷方式值得记住为你,这完全取决于您的工作流程。您可以自行选择以下选项:
Ctrl-a Move to the start of the line.
Ctrl-e Move to the end of the line.
Ctrl-b Move back one character.
Alt-b Move back one word.
Ctrl-f Move forward one character.
Alt-f Move forward one word.
Ctrl-] x Where x is any character, moves the cursor forward to the next occurrence of x.
Alt-Ctrl-] x Where x is any character, moves the cursor backwards to the previous occurrence of x.
Ctrl-u Delete from the cursor to the beginning of the line.
Ctrl-k Delete from the cursor to the end of the line.
Ctrl-w Delete from the cursor to the start of the word.
Esc-Del Delete previous word (may not work, instead try Esc followed by Backspace)
Ctrl-y Pastes text from the buffer (similar to clipboard).
Ctrl-l Clear the screen leaving the current line at the top of the screen.
Ctrl-x Ctrl-u Undo the last changes. Ctrl-_ does the same
Alt-r Undo all changes to the line.
Alt-Ctrl-e Expand command line.
Ctrl-r Incremental reverse search of history.
Alt-p Non-incremental reverse search of history.
!! Execute last command in history
!abc Execute last command in history beginning with abc
!abc:p Print last command in history beginning with abc
!n Execute nth command in history
!$ Last argument of last command
!^ First argument of last command
^abc^xyz Replace first occurrence of abc with xyz in last command and execute it