Questions tagged [zshrc]

The .zshrc file is the configuration file for zsh.

Zsh is a feature rich shell, with many of the features of bash, tsch, csh, and ksh. The .zshrc file is the configuration file for that shell, and it allows zsh to be configured to the user's needs.

616 questions
9
votes
2 answers

zsh shell is not showing git branch name

I have following code in my .zshrc file. When I go to my repos and the git branch name is not showing up on the right side of the console until I source the .zshrc file with source ~/.zshrc parse_git_branch() { git branch 2> /dev/null | sed -e…
Aron Lee
  • 607
  • 1
  • 5
  • 8
9
votes
3 answers

How to use escape sequences in a ZSH prompt for truecolor or bold?

I am in the middle of customizing my ZSH prompt but am seemingly unable to use escape sequences to tell Konsole to use bold text or a specific RGB color. I know about the built in formatting options in ZSH, like %F{000} %f, but as far as I know,…
0x131
  • 99
  • 1
  • 2
9
votes
1 answer

How does the zsh list-colors syntax work?

I am trying to set the list-colors for a completion function, but I just can't wrap my head around the styling syntax. zstyle ':completion:*:tasks:*' list-colors "=(#b) #([^ ]#)*=$color[white]=$color[yellow]=$color[red]" All i know is that '#' and…
saller
  • 93
  • 2
  • 4
9
votes
4 answers

RVM and Gemfile - not always loading correct ruby, only when 'cd .. & cd myproject'

TL;DR: Every time I open a new iterm2 tab, rvm goes back to default version, it doesn't use the Gemfile ruby version My Gemfile has source 'https://rubygems.org' ruby '2.0.0' and I use rvm 1.25.14. RVM is smart and reads the ruby version in…
oma
  • 38,642
  • 11
  • 71
  • 99
9
votes
1 answer

.zshrc config file syntax error

I'm getting a syntax error somewhere in my .zshrc file and I can't seem to find it. I'm getting this error message: .zshrc:49: bad assignment Here is my .zshrc file: # Path to your oh-my-zsh configuration. ZSH=$HOME/.oh-my-zsh # Set name of the…
Joshua Soileau
  • 2,933
  • 9
  • 40
  • 51
8
votes
2 answers

Zsh not recognizing alias from within function

Here's my .zshrc: alias inst="adb install -r -d" notify() { start=$(date +%s) "$@" notify-send "\"$(echo $@)\" took $(($(date +%s) - start)) seconds to finish" } When I run the command notify inst app.apk, I get an error: notify:2: command…
Caleb Jares
  • 6,163
  • 6
  • 56
  • 83
8
votes
2 answers

zshrc alias gets executed when launching a new terminal

I am using zsh and in my config I am adding another alias : alias recursively_git_pull_all_repo="for dir in $(find . -name ".git"); do cd ${dir%/*}; git pull ; cd -; done" However this alias seems to get executed every time I open a new terminal…
nha
  • 17,623
  • 13
  • 87
  • 133
8
votes
1 answer

checkwinsize equivalent in zsh?

I am migrating from bash to zsh and as part of that I am transitioning over my dotfiles. Is there an equivalent to "checkwinsize" in zsh? I couldn't find one after searching, the relevant code in my .bashrc is shopt -s checkwinsize I tried setopt…
Andrew
  • 6,295
  • 11
  • 56
  • 95
8
votes
4 answers

How to save the current working directory to Zsh history?

I wanted to achieve the same as asked here Saving current directory to bash history but within Zsh shell. I haven't done any Zsh trickery before but so far I have: function precmd { hpwd=$history[$((HISTCMD-1))] if [[ $hpwd == "cd" ]]; then …
Kabira K
  • 1,916
  • 2
  • 22
  • 38
8
votes
3 answers

How can I define custom colors for use in ZSH prompt?

I'm having some difficulty configuring my zsh prompt. Specifically I would like the font to have the color defined by the hex code: #87afdf Currently, I've set up the prompt as follows: PROMPT='%B[%d] ➞ %b' I've attempted to add colors in the…
ggelfond
  • 321
  • 1
  • 2
  • 5
7
votes
2 answers

Echo all aliases in zsh

Is it possible to force zsh to echo the actual commands referred to by all aliases when they are used? For example, say that I have the following aliases set: # List direcory contents alias lsa='ls -lah' alias l='ls -la' alias ll='ls -l' When I…
Aaron Massey
  • 3,826
  • 1
  • 28
  • 26
7
votes
3 answers

my zsh prompt is not bold

I am customizing my zsh terminal but I face difficulties when it comes to turn my prompt into bold. I tried several different things, but none worked, whereas it did work for people on the Internet... So this is my test prompt. Both "HEY" are in…
nounoursnoir
  • 671
  • 2
  • 10
  • 25
7
votes
2 answers

What is the correct setup for Brew + Zsh + Oh My Zsh on multiple admin users on Mac OS X?

My question is what would be a good way to run two admin accounts for developing in regards to running Homebrew, Zsh and Oh My Zsh and configuring the .zshrc file? My reasoning for this is that I recently started a new job and would like to use my…
joshuatvernon
  • 1,530
  • 2
  • 23
  • 45
7
votes
3 answers

RVM showing Ruby version in ZSH

I just installed rvm to upgrade ruby using the method outlined here. After installation my zsh instance now always displays rvm:ruby-2.3.0, as per this image: I'd rather it not appear but I'm having trouble finding where it's set, any thoughts?…
bulletblue
  • 129
  • 1
  • 7
7
votes
1 answer

Does nvm have to be before rvm in PATH?

Why does nvm is added before /home/user/.rvm/gems/ruby-2.2.3/bin in PATH ? echo…
Islam Azab
  • 700
  • 6
  • 22