Notes on the "how", complementing the demo about the "why".
chsh -s $(which zsh)
Plugin manager and other cool things.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install a "Nerd Font", with usefull icons included, then configure your terminal to use it.
I recommend JetBrainsMono Nerd Font
.
Don't use the one provided, they are obsolete and slow. I recommend Powerlevel10k which is fast, have great defaults, a simple configuration form (in command line), and can be customized to look like some other popular ones like pure.
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
Set ZSH_THEME="powerlevel10k/powerlevel10k"
in ~/.zshrc.
Launch Zsh and complete configuration.
Simpler and faster git integration plugin.
Just add gitfast
to the .zshrc
plugin list (plugins=(...)
).
GitHub clvv/fasd / Installation
Like autojump
and z
, fasd
adds more command line for quick action (cd / vim / open / etc) by letting the machine figure out what file or folder you are talking about, loosely matching your history.
Some commands :
z
- smart
cd
- smart
v
- smart
vi
- smart
o
- smart open file
f
- smart print full path (to incorporate
fasd
intelligence in other command)
- smart print full path (to incorporate
See link for install depending on your OS, then add fasd
to the .zshrc
plugin list (plugins=(...)
).
GitHub zsh-users/zsh-autosuggestions / Installation
Autocompletion suggestions.
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Then add zsh-autosuggestions
to the .zshrc
plugin list (plugins=(...)
).
GitHub nvbn/thefuck / Installation
After a botched command, type fuck
to have suggestions on the corrected command, and validate the new one with enter. For exemple, with a failed git push new_local_branch
, it proposes automatically the better git push --set-upstream origin new_local_branch
.
After installation, add this to your ~/.zshrc
:
eval $(thefuck --alias)
GitHub pyenv/pyenv / Installation
After installation, add this to ~/.zshrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# pyenv-virtualenv: prompt changing will be removed from future release.
# configure to simulate the behavior.
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
Then add pyenv
in the plugin list already in this file (plugins=(...)
).
If you use a powerlevel10k theme, you might have duplicated information (virtualenv + pyenv).
In your ~/.p10k.zsh
file, comment out virtualenv
from POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS
.
If some of your pyenv environment needs a specific pip conf but not all of them, you can create a function which configure the current pyenv environment with a specifice pip conf like this :
# Set a specific pip conf for the current pyenv environment
setspecificpipconf () {
ln -s /XXX/SPECIFIC_pip.conf `pyenv prefix`/pip.conf
}
GitHub sharkdp/bat / Installation
Like cat
, but with syntax highlighting and git status line indicator.