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
3
votes
1 answer

zsh (256colors): default background color as foreground color

I can easily switch back to the terminal default coloring scheme using %k (background) or %f (foreground). There is also the option to use %K(default) or %F(default) which produces the same results. How can I change the foreground color to the…
alexschomb
  • 126
  • 3
  • 13
3
votes
3 answers

Getting a zsh alias including a pipe to execute

I wanted a command that would quickly copy the current tmux window layout to the clipboard on Mac using zsh. I came up with the following: tmux list-windows | awk '{print $7}' | sed 's/\]$//' | pbcopy When I run this from the command line it works…
3
votes
1 answer

Chaning MacVim's default shell?

I currently have my default shell set to zsh in terminal. However, upon execution !echo $SHELL in MacVim, it returns /bin/bash, which is obviously the shell that I don't want. How can I set zsh as my default in MacVim? Note: I've attempted to :set…
Brandon Mercer
  • 403
  • 1
  • 4
  • 10
3
votes
0 answers

Asynchronous RPROMPT? OR, faster git status for RPROMPT?

Since I started using git I've had my RPROMPT setup to show the current branch. I've recently been using some of the "fancy" scripts to show un/staged file counts and other useful at a glance things.…
Halnry
  • 418
  • 2
  • 10
3
votes
0 answers

Completion for Hadoop command in zsh

I love the tab completion feature in zsh. But when I use hadoop command, it seems do not work anymore. So is there any idea to auto-completion for hadoop command in zsh? Many thanks.
shao
  • 31
  • 3
3
votes
3 answers

rbenv version display in zsh right-prompt not refreshing

I have the following code in my .zshrc: local ruby_version='' if which rvm-prompt &> /dev/null; then ruby_version="$(rvm-prompt i v g)" else if which rbenv &> /dev/null; then ruby_version="$(rbenv version | sed -e "s/ (set.*$//")" …
Mark Nichols
  • 1,407
  • 2
  • 19
  • 25
3
votes
2 answers

ZSH auto_vim (like auto_cd)

zsh has a feature (auto_cd) where just typing the directory name will automatically go to (cd) that directory. I'm curious if there would be a way to configure zsh to do something similar with file names, automatically open files with vim if I type…
seagullJS
  • 529
  • 1
  • 5
  • 8
3
votes
1 answer

zsh random color in PS1

My .bashrc PS1 (abridged) is \u\[\e[01;3$(($RANDOM % 8))m\]@\h \w $' With the way bash works, it interpolates the random color after each command so the @ is a different color each time (at least in the 31-37 range). However, I've been unable to do…
Explosion Pills
  • 188,624
  • 52
  • 326
  • 405
3
votes
1 answer

ZSH and Oh-My-Zsh local environment mapping?

I used Bash Shell for a long time and recently switched to ZSH because of the greatness of the project O-My-Zsh. I have no problems how to use the zsh but setuping the local environment. I am currently using the dotfiles structure from Peepcode…
MMA
  • 525
  • 2
  • 10
  • 19
2
votes
2 answers

In macOS, How to get back the contents of `.zshrc` file after installing `Oh-My-Zsh` framework which replaced it with its configurations?

After installing Oh My Zsh framework on my macOS to manage my Zsh configurations, I found that the original contents of the .zshrc file have been completely replaced with the Oh-My-Zsh configurations. There were many aliases and environment…
Amr
  • 4,809
  • 6
  • 46
  • 60
2
votes
1 answer

zsh: command not found: flutter

I added the path in .zshrc file but it is still saying command not found, i tried 100 times but it is not working my .zshrc file my flutter folder path what am I doing wrong?
sarakhan
  • 49
  • 1
  • 12
2
votes
2 answers

zsh: command not found: openai (on WSL)

I was trying to install openai to fine tune the model and use opeanAI cli to train the model. python --version Python 3.10.6 I also installed openai package pip show openai Name: openai Version: 0.26.4 Summary: Python client library for the OpenAI…
Vansh
  • 43
  • 4
2
votes
0 answers

Starship cross-shell prompt is not working on Mac zsh

I'm using a Mac and followed the instructions to install with homebrew and added eval "$(starship init zsh)" to ~/.zshrc. However, when I restarted my terminal it still shows the default one. Here's the content of my .zshrc (added the line at the…
2
votes
1 answer

/etc/zshrc:7: command not found: locale

Every time I open the terminal in my Mac, I get the error /etc/zshrc:7: command not found: locale . when I type "printf '%s\n' $path" i get: /condabin "/opt/homebrew/bin /opt/homebrew/sbin${PATH+ $PATH}"; It is possible that I have somehow…
Saman
  • 23
  • 4
2
votes
0 answers

Why does sourcing a file inside a conditional block behave different than outside of one?

Can someone please explain why the first snippet in my ~/.zshrc works and the second produces an error? When written like this (no error): BASE16_SHELL="$HOME/.config/base16-shell/" [ -n "$PS1" ] && [ -s "$BASE16_SHELL/profile_helper.sh" ] && source…