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.

459 questions
14
votes
3 answers

zsh prompt and hostname

I use the following prompt in .zshrc: PROMPT="%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%1~ %{$reset_color%}%# " When I open terminal I see this prompt: zoltan@zoltan-Macbook-Pro ~ % Is it possible to drop the text "zoltan"…
Zoltan King
  • 1,596
  • 2
  • 12
  • 19
13
votes
3 answers

Setting ZSH_DISABLE_COMPFIX=true in .zshrc doesn't work

I need to disable the zsh's COMPFIX process to suppress the following warning I see every time I open a terminal window: zsh compinit: insecure directories and files, run compaudit for list. The cause of the warning is not the issue here; I have…
jonsanders101
  • 455
  • 1
  • 5
  • 12
13
votes
3 answers

Binding option left and right arrows to move by words in zsh command line

I'm using iTerm2 on Mac OSX 10.8 with an xterm key binding and zsh. I'd like zsh to use option left arrow and option right arrow to do the standard Mac bindings of left and right word. If I hit ctrl-v then option-left and right arrows, where are the…
justingordon
  • 11,553
  • 9
  • 64
  • 111
12
votes
1 answer

Get the `pwd` in an `alias`?

Is there a way I can get the pwd in an alias in my .zshrc file? I'm trying to do something like the following: alias cleanup="rm -Rf `pwd`/{foo,bar,baz}" This worked fine in bash; pwd is always the directory I've cd'd into, however in zsh it seems…
Phillip B Oldham
  • 17,339
  • 17
  • 83
  • 127
12
votes
2 answers

Is it possible to bindkey Shift+Enter in zsh?

I'm starting to use zsh on macOS Sierra. I would like to have the following key mappings: Enter => accept-line Shift-Enter => accept-and-hold However, I can't seem to differentiate between the two. I'm only able to get Enter, and Esc-Enter, but…
Joseph Pecoraro
  • 2,820
  • 1
  • 18
  • 25
12
votes
1 answer

Print executed alias in zsh or bash

The scenario is currently, I have defined some aliases in .zshrc like alias gco='git checkout' alias cdp='cd ..' and lots like that. My question is How to print out the command each time I typed an alias and press enter? ex: $> gco master >…
Transparency
  • 325
  • 3
  • 10
11
votes
1 answer

zsh change prompt input color

I want to change the color of the input text in zsh (the text that I type for each command). Example: in user@host> ls ~/ I would want ls ~/ to be yellow to stand out from standard output. I know I can accomplish this in bash using export PS1="…
Sherwin Yu
  • 2,940
  • 1
  • 21
  • 37
11
votes
2 answers

LANG environment variable in zsh

I recently installed sublime text on a new ubuntu machine. During start up I get the following error message : Your system's locale is set to a value that can not handle non-ASCII characters. Package Control can not properly work unless this is …
newbie
  • 979
  • 3
  • 14
  • 27
11
votes
3 answers

Adding an alias for Sublime Text to zshrc

Just have a quick question on how to add an alias for SublimeText to my ZSH. I've been to their site where they tell you how to do it within bash, but I don't understand how to do it within ZSH. It has been killing me, I just want to open text files…
saltex
  • 133
  • 1
  • 1
  • 5
10
votes
3 answers

git add auto-complete filename

I am working on a git project. Since I have a lot of folder deepness, I would like to improve my auto-completion to work with filenames and not only paths. Here is an example: $git status …
nsvir
  • 7,723
  • 10
  • 27
  • 45
10
votes
2 answers

Using ANSI escape sequences in zsh prompt

I'm trying to use ANSI escape sequences to set the color of my zsh prompt, but the escape character (\e) seems to be being escaped when displaying the prompt. Here's an example of what I'm running and the output I'm getting: > autoload promptinit &&…
robbiemc
  • 103
  • 1
  • 5
10
votes
1 answer

Adding directory to the path in .zshrc

I have been on this issue for a couple days now. I use zsh and need to set a directory path so that the command i use will be recognized. Following these steps so far: cd ~ ls -al ls -al shows me these…
Malloc
  • 12,816
  • 31
  • 101
  • 184
9
votes
1 answer

How does the matcher-list arguments work in zsh zstyle completion?

I'm trying to configure my ~/.zshrc so code completion on files/dirs work as I need it. I've found various ressources online on the zstyle completion syntax, and code example but some parts of it are still black magic to me. So far, here is where I…
pixelastic
  • 4,678
  • 6
  • 21
  • 28
9
votes
4 answers

How does one locate a .zshrc file?

I used Homebrew to install Z shell (zsh) 5.0.7 on my Mac. For the life of me, .zshrc is nowhere to be found. It is not in ~. Is is not in /etc or /etc/zshrc as they suggest here: http://zshwiki.org/home/config/files Am I supposed to create it…
Ulysse
  • 93
  • 1
  • 1
  • 3
9
votes
1 answer

Vim use a variable interpolated within a String?

I have a .zshrc and .vimrc file In my .zshrc file I have syncfolder="$HOME/Google Drive/Dropbox" I now want to reference syncfolder within my .vimrc file, is this possible (if so, how)? Also, within my .vimrc file I'm sourcing lots of other files…
Integralist
  • 2,103
  • 28
  • 49
1 2
3
30 31