the shortcut cmd + u or the ctrl + u is used to delete the content of current cursor back to the start of line, not always delete the whole line

This commit is contained in:
Jason
2016-11-13 09:15:55 +08:00
parent 3daa6d45c0
commit 7ba78d15a4
3 changed files with 3 additions and 3 deletions

View File

@@ -78,7 +78,7 @@
- 在 Bash 中,可以使用 **Tab** 自动补全参数,使用 **ctrl-r** 搜索命令行历史(在按下之后,键入便可以搜索,重复按下 **ctrl-r** 会在更多匹配中循环,按下 **Enter** 会执行找到的命令,按下右方向键会将结果放入当前行中,使你可以进行编辑)。
- 在 Bash 中,可以使用 **ctrl-w** 删除你键入的最后一个单词,使用 **ctrl-u** 删除整行,使用 **alt-b****alt-f** 以单词为单位移动光标,使用 **ctrl-a** 将光标移至行首,使用 **ctrl-e** 将光标移至行尾,使用 **ctrl-k** 删除光标至行尾的所有内容,使用 **ctrl-l** 清屏。键入 `man readline` 查看 Bash 中的默认快捷键,内容很多。例如 **alt-.** 循环地移向前一个参数,以及 **alt-*** 展开通配符。
- 在 Bash 中,可以使用 **ctrl-w** 删除你键入的最后一个单词,使用 **ctrl-u** 删除当前光标所在位置之前的内容,使用 **alt-b****alt-f** 以单词为单位移动光标,使用 **ctrl-a** 将光标移至行首,使用 **ctrl-e** 将光标移至行尾,使用 **ctrl-k** 删除光标至行尾的所有内容,使用 **ctrl-l** 清屏。键入 `man readline` 查看 Bash 中的默认快捷键,内容很多。例如 **alt-.** 循环地移向前一个参数,以及 **alt-*** 展开通配符。
- 你喜欢的话,可以键入 `set -o vi` 来使用 vi 风格的快捷键,而 `set -o emacs` 可以把它改回来。