Improve your terminal with suggestions from your history with zsh

If you want enable command prediction on your terminal, a good option is to install zsh.

sudo apt-get install zsh 

Now, replace bash by zsh with the following instruction:

chsh -s /bin/zsh $USER

where $USER is your user account (whoami)

Now, install Oh My Zsh:

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

And finally install Fish-like autosuggestions for zsh:

git clone http://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

Edit your ~/.zshrc file and add zsh-autosuggestions as a plugin:

plugins=(git zsh-autosuggestions)

If you like, you can change your terminal theme. I like cobalt2:

git clone https://github.com/powerline/fonts.git
./install.sh

git clone https://github.com/wesbos/Cobalt2-iterm.git
cd Cobalt2-iterm 
mv cobalt2.zsh-theme ~/.oh-my-zsh/themes 
vim ~/.zshrc 
ZSH_THEME="cobalt2"


If you want compatibility with your root user, you must do the following steps:

sudo su
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
ln -s /home/$USER/.oh-my-zsh /root/.oh-my-zsh 
mv /root/.zshrc /root/.zshrc.bak
ln -s /home/$USER/.zshrc /root/.zshrc
zsh --

Now re-login your session

Enjoy it!



Comments

Popular posts from this blog

How to fix Android when developer options are not available for this user

from: can't read /var/mail/ in Python scripts

Fix "Set scan parameters failed: Input/output error" on Ubuntu 16.04