Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zsh theme for full path + display git changes

I'm looking for theme to display a full path + git (branch name + uncommitted changes + added files). Didn't find any. something like this:

/full/path/to/repo (master *+) 

would love a recommendation of one / a tip of how to edit an existing one (I am currently using Godzilla).

like image 670
Ohad Perry Avatar asked Jan 11 '15 07:01

Ohad Perry


People also ask

How do you show the full path in oh my zsh?

To get the full path path of your current working directory use %d . I'm assuming you're using oh-my-zsh. In order to accomplish what you want, you can create a modified version of the Godzilla theme and replace the %c (which just shows the current folder) with %d in the PROMPT .

How do I customize my zsh-theme?

To change the Theme, simply change the ZSH_THEME value in ~/. zshrc file from robbyrussell to Avit. Run the following command to update the config. Open ITerm2 > Preferences > Profiles > Colors and change the background black color to use 20% gray as shown below.

How do I check my current zsh-theme?

You can use prompt -c which will print the current theme.


1 Answers

You can modify the second line of this file:

~/.oh-my-zsh/themes/robbyrussell.zsh-theme 

Which looks like this:

PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' #                       ^ replace c with ~ 

Then source theme again:

source ~/.zshrc 

It will now show the path relative to your home directory (~). For example:

# BEFORE ➜  sqlboiler git:(master) # AFTER ➜  ~/open-source/sqlboiler git:(master) 
like image 89
Jim Chen Avatar answered Sep 25 '22 22:09

Jim Chen