It's a pleasure to use zsh for last several months and being quite impressed about its efficiency. I specially use zsh for my rails development. In this post how it can be used for rails development will be discussed.
For basic information like what is zsh, how to install etc. this post will be very helpful.
Required Plugins for Rails Development
First we need to make sure to have rails, git, ruby and bundler plugins are installed, so that we can use them in shell. To install them we need to change
the hidden file ~/.zshrc (it's normally in home directory in ubuntu). Open the hidden file ~/.zshrc and edit the
plugins line it like this:
More than 140 themes are available for zsh shell. We can choose from them from here. This page shows the preview of every themes available.
For example I found this theme user friendly. Its name Honukai. Theme Preview:
To install it again we need to edit in the ~/.zshrc file `ZSH_THEME` line like this:
Aliases in Rails development
Using alias is one of the main purposes for using zsh. It makes our command very short which increase efficiency.
- to open rails server the command is
- rails console:
- to generate model user
rg model User, for controller
rg controller users
- to create db:
- see routes:
- for bundle install:
- bundle update:
Here the complete set of rails and rake command aliases:
A version controlling system like Git is used almost all kind of development works. Zsh provides a great amount of git aliases which makes the programmer job much easier. As the developer need to use it frequently long git command can be annoying. Think of a git command those are replaced like this:
git push origin $(current_branch)with this
git pull repository_name brach_namewith
gl repo_name branch_name
git checkout $(branch)with
git reset HEAD --hardwith
Here is complete set git aliases for zsh. Some sample given below:
I hope this post will help you for your rails development. This [link](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) will be helpful for other development purposes. Thanks for reading.