zshrc

Why does virtualenv inherit $PYTHONPATH from my shell?

两盒软妹~` 提交于 2019-12-04 05:42:26
So I'm migrating all my tools from python2 to python3.4 on an Ubuntu 14.04 machine. So far I've done the following: aliased python to python3 in my zshrc for just my user installed pip3 on the system itself (but I'll just be using virtualenvs for everything anyway so I won't really use it) changed my virtualenvwrapper "make" alias to mkvirtualenv --python=/usr/bin/python3 ('workon' is invoked below as 'v') Now curiously, and you can clearly see it below, running python3 from a virtualenv activated environment still inherits my $PYTHONPATH which is still setup for all my python2 paths. This

zsh prompt and hostname

笑着哭i 提交于 2019-12-04 03:35:23
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" in the hostname? I would like to make it look like this: zoltan@Macbook-Pro ~ % Any suggestion would be greatly appreciated. Thank you! It's a bit of a mess, but you can pretend the %m is a parameter and use parameter expansion to strip the zoltan from the host name: PROMPT="...${${(%):-%m}#1} ..." A little explanation. First, you create a "parameter

ZSH auto-complete screws up command name

落花浮王杯 提交于 2019-12-04 01:22:06
问题 When I start doing tab auto-complete of a command, it keeps what I initally typed next to it and the command becomes unreadable. In the example below, I typed 'git che' and hit tab. Once I select 'checkout' the command prompt becomes 'git che git checkout'. The command still works and in my history it stores 'git checkout'. But its pretty annoying visually. Is there anyway to change this behavior. I tried this in 2 different terminal emulators, so I can confirm its ZSH and not the emulator.

ZSH highlight on tab

断了今生、忘了曾经 提交于 2019-12-03 16:20:39
问题 One of the features that I kept hearing about zsh was that it will highlight your selection as you tab through a list of possible choices. Such as choosing a directory to cd into. I thought this feature would be enabled automatically, but it doesn't appear to be. At the moment I have this in my .zshrc for git auto completion zstyle ':completion:*:*:git:*' script /usr/local/etc/bash_completion.d/git-completion.bash fpath=(/usr/local/share/zsh-completions $fpath) autoload -U compinit &&

Zsh & RVM woes (rvm-prompt doesn't resolve)

≡放荡痞女 提交于 2019-12-03 16:06:39
问题 I recently saw the light and changed over to Zsh. I naturally used Oh My Zsh to configure it, as I'm noobish. So, there are several themes that have an rvm-prompt included and here is were my problems began. Everytime I load Zsh I have to rvm reload or else rvm-prompt is not resolved ( zsh: command not found: rvm-prompt ). Note that it resolves fine after I reload. Also, and in line, when I go to a directory that has its own .rvmrc (other gemset) and then I come out of it, the same problem

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

廉价感情. 提交于 2019-12-03 13:53:23
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 am, after some fiddling and testing : zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'm:{a-zA-Z}={A-Za-z} l:|=* r:|=*' Here is what I understand from it : zstyle ':completion:*' means we are going to define a config value for completion matcher-list is the config we update, here it defines how zsh match files/dir to suggest 'm:{a-zA-Z}={A

zsh change prompt input color

醉酒当歌 提交于 2019-12-03 13:31:06
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=" $BIGreen \u@\h \w \$ $IYellow" At the end of the prompt, the color is set to Yellow, input text I type is yellow (with the appropriate color variables defined). And then trap 'echo -ne "\e[0m"' DEBUG Which resets the color to normal when the outputs of my command are displayed. How can I accomplish this in zsh ? Currently, I have PROMPT=$'{$fg[green]%}

bindkey with zsh on Mac

邮差的信 提交于 2019-12-03 11:52:35
问题 I've been trying to bind keys in zzh on a Mac but am having some trouble. I know I should be Googling this but couldn't find what I need... I've been trying to bind ctrl-backspace to be an equivalent of ctrl-w, ie delete one word. But I can't find the key code for it. Nothing shows up when I do it with 'read'. I can't find a chart online either. Also, I couldn't bind home/end keys (ie fn-left, fn-right) somehow. It is not bound in Terminal's keyboard assignments or .zshrc but it's still doing

Zsh & RVM woes (rvm-prompt doesn't resolve)

一个人想着一个人 提交于 2019-12-03 05:32:58
I recently saw the light and changed over to Zsh. I naturally used Oh My Zsh to configure it, as I'm noobish. So, there are several themes that have an rvm-prompt included and here is were my problems began. Everytime I load Zsh I have to rvm reload or else rvm-prompt is not resolved ( zsh: command not found: rvm-prompt ). Note that it resolves fine after I reload. Also, and in line, when I go to a directory that has its own .rvmrc (other gemset) and then I come out of it, the same problem occurs; I'm left with having to reload Zsh again. I have RVM in $PATH set. I have [[ -s "$HOME/.rvm

ZSH RPROMPT weird spacing?

倖福魔咒の 提交于 2019-12-03 00:07:56
Here is my ZSH prompt theme function git_prompt_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" } PROMPT='$fg[yellow]%}⚡︎ $fg[cyan]%~ $(git_prompt_info) %{$reset_color%}→ ' ZSH_THEME_GIT_PROMPT_PREFIX="[git:" ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color" ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]+" ZSH_THEME_GIT_PROMPT_CLEAN="$fg[green]" RPROMPT='%T' Which looks like When I move the $(git_prompt_info) to RPROMPT function git_prompt_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return