2020-10-16
|~2 min read
|281 words
Though potentially less daunting than Vim or Emacs, mastering zsh
is a long road, but a few keyboard shortcuts can help to make you feel much more productive.
Two that I have looked up a number of times are jumping to the start and end of a line. I’ll probably have to look them up again in the future, but at least now I’ll have a place where I can keep track of the different keyboard shortcuts I come across for zsh
.
Ctrl A
- Jump to the start of the lineCtrl E
- Jump to the end of the lineCtrl F
- Jump forward one characterCtrl B
- Jump backward one characterAlt F
- Jump forward one word1Alt B
- Jump backward one word1Ctrl U
- Clear the entire lineCtrl K
- Clear line after the cursorCtrl W
- Clear the word before the cursorCtrl R
- Open Back Search. The back search allows you to search the zsh
history for commands you’ve run in the past. If one is found, it will be populated on the line above the search and you can press Enter
to execute. Interestingly, the search seems to take you to that point in history, meaning if you navigate with your arrow keys you will be navigating that part of zsh
’s history.Alt
key. To get it to work, you may need to remap your keyboard.Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!