zsh
Zsh is a Unix shell based on the Bourne shell, like bash.
Installation
Use homebrew to install Zsh:
$ brew install zsh
To set it as your default shell:
$ sudo sh -c "echo $(which zsh) >> /etc/shells" && chsh -s $(which zsh)
Shortcuts
These shortcuts work in Bash as well.
Keystroke | Description |
---|---|
Ctrl + A / Ctrl + E | Go to start/end of line |
Ctrl + W | Delete previous word |
Ctrl + U / Ctrl + K | Remove everything from cursor to beginning/end of the line |
Ctrl + X + E | Open a temporary file in $EDITOR that will be executed on close |
Oh My Zsh
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration.
Installation
To install, use this:
$ curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
Plugins
Plugins are installed using Oh My Zsh and the ~/.zshrc
file.
z
: "Zsh-z is a command line tool that allows you to jump quickly to directories that you have visited frequently in the past, or recently -- but most often a combination of the two (a concept known as "frecency"). It works by keeping track of when you go to directories and how much time you spend in them."
Preinstalled
- Git shortcuts:
git
is aliased tog
and many of the most used commands are aliased as well, likegaa
isgit add .
andgcmsg
isgit commit -m
, etc. You can find a list of the shortcuts in the oh-my-zsh repo[2].
Profile
Your profile, which includes your different environment variables, can be found at .zprofile
.
References
- https://gist.github.com/derhuerst/12a1558a4b408b3b2b6e#file-mac-md
- https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh
- https://www.sitepoint.com/zsh-commands-plugins-aliases-tools/
Incoming Links
Last modified: 202401040446