Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

As a Ruby/Rails Developer, zsh vs bash? What's the advantage? [closed]

Tags:

bash

shell

ruby

zsh

I've seen a lot of people recommend zsh over bash for ruby development and i'm failing to understand what zsh offers over bash?

The answerable question for this post is:

What benefit, specific to ruby developers, does one see when using zsh instead of bash?

Thank you!

like image 683
Mario Zigliotto Avatar asked Nov 13 '12 16:11

Mario Zigliotto


People also ask

Should I write scripts in Bash or Zsh?

If you're writing scripts for others to use, you should stick with bash, as zsh isn't always installed, and many developers who know bash may not be familiar with the particulars of zsh.

Should I use Bash or zsh on Mac?

The Z shell (also known as zsh ) is a Unix shell that is built on top of bash (the default shell for macOS) with additional features. It's recommended to use zsh over bash . It's also highly recommended to install a framework with zsh as it makes dealing with configuration, plugins and themes a lot nicer.

Is zsh better than Bash?

Zsh is built on top of bash thus it has additional features. Zsh is the default shell for macOS and Kali Linux. Zsh provides the user with more flexibility by providing various features such as plug-in support, better customization, theme support, spelling correction, etc.

What is a difference between zsh and Bash profile?

Bash sets the prompt from PS1 which contains backslash escapes like \a whereas zsh contains the percent escapes like %d. The functionality of bash PROMT_COMMAND is available in zsh via precmd. Zsh also offers ways to do fancy customizations.


1 Answers

Edit : this applies if you use oh-my-zsh

Personally, I'm mainly using it because it displays your current git branch in the command prompt. Therefore, if like me you often have to switch branches, you don't mix code by accident.

Also, one of the nice benefits for me is that I created a fork of oh-my-zsh with my custom theme enabled by default, and I can deploy it on whatever machine I need it onto (say, production servers) with just a few commands. This way, I load up all my zsh aliases, my custom theme etc ...

Finally there's a zsh plugin I'm using that is zsh-syntax-highlighting. This highlights commands as you type them, to make it dummy-proof. Green = good existing command, red = you made a typo ... but there's more to it, it's worth a try.

So yeah, git integration and the ability to install my own personal zsh setup on whatever machine within seconds is why I like it.

There's also a railscast talking about oh-my-zsh : http://railscasts.com/episodes/308-oh-my-zsh

like image 198
Anthony Alberto Avatar answered Oct 13 '22 21:10

Anthony Alberto