Here is my setup for my shell. I use Z shell, an extended Bourne shell, with oh-my-zsh for its configuration. I also use fzf which is a fuzzy finder. Finally, I use tmux which is a terminal multiplexer: ie, you can switch between terminals and detach/attach to them.
Disclaimer: The commands and configurations are not my original work, I have mostly copied and put together configuration that I like and find useful.
Summary:
- Install zsh, fzf, oh-my-zsh, tmux
- Configuring
- Basic how to use
To install zsh and set it as default, follow these instructions.
The two main steps are:
brew install zsh
chsh -s $(which zsh)
To install fzf, execute this and answer yes for all the questions:
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
For more detail on the fzf installation, see this
To install oh-my-zsh, execute this:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
For more detail on the oh-my-zsh installation, see this
To install the oh-my-zsh plugins, run:
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
brew install tmux
To configure, just use the files (.zshrc
, .tmux.conf
, agnoster.zsh-theme
) of this repo. For zsh and tmux, replace the .zshrc
and .tmux.conf
files on your home with the ones on the repo. For agnoster.zsh-theme
, copy it in ~/.oh-my-zsh/themes
. For .zshrc
, compared to the original file, it mainly changes the following lines:
ZSH_THEME="agnoster"
I prefer this theme, this is purely aesthetic.
plugins=(git vi-mode zsh-autosuggestions)
The plugin vi-mode
allows you to use vim in the command line and zsh-autosuggestions
will add an autocompletion feature. Lastly, the following add fzf:
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
bindkey -s '^e' 'vim $(fzf)\n'
cs() { cd "$1" && ls; }
- For zsh, you don't need to do anything special, you should now have a really useful autocompletion in your shell.
- For fzf, the most important functionalities are:
ctrl-t
andctrl-r
to respectively find files on your system or find commands in your history. - For tmux, execute
tmux
to start it. Then, to create new panes, usectrl--
orctrl-|
for horizontal and vertical pane. To move between panes, usectrl
with the directional keyshjkl
as in vim.