Today I’d like to show you really usefull tool for working in command line I’ve discovered – ZSH. The Z Shell (zsh) is a power shell that is not often used by many Linux users. The reason for this is that most Linux distributions install, and make default, the bash shell. zsh is packaged for virtually every Linux distribution and installation on Ubuntu is simple made by running
After installation main configuration file .zshrc is located in you’r home directory. To make zsh as default shell run chsh command and include path to it’s executable:
1 2 3 4 5
One of the great features of zsh is tab-completion; it also handles all the logistics of tab-completion and is extremely easy to implement, just by adding two lines to your ~/.zshrc file:
The compinit function is what loads the tab-completion system by defining a shell function for every utility that zsh is able to tab-complete. By using autoload, you can optimize zsh by telling it to defer reading the definition of the function until it’s actually used, which speeds up the zsh startup time and reduces memory usage.
After installation you might need to reload you shell:
Each time you cd to you git repo it will show you branch you currently working on and whether you have uncommited local changes or not, if so it will show you gold sign: Also there are a lot of themes for this plugin you can choose to use the other one then default “robbyrussell” theme. List of themes you can get at this link. To change to other one you need to edit you .zshrc file and reload shell.
You can also use aliases after adding it to your config file. To add time of command prompting to the right side of terminal append following line to your config file: