For some reason, zsh does not like me to set command line arguments for my variable $EDITOR, but from what I can say this should not be so. I saw people use
export EDITOR='open -Wn'
in the ~ / .zshrc file, but when I try to do this, I just get a complaint.
zsh: command not found: open -Wn
Any reason why this could happen? Installation $EDITORin 'mate', 'vim'or 'open'seems very good, but 'mate -w'also 'open -Wn'do not work.
I run zsh inside the screen on Mac OS X, and my ~ / .zshrc looks like this:
if [[ $STY == '' ]]; then
exec screen -aADRU
fi
cd ~/Desktop
[[ -s "~/.rvm/scripts/rvm" ]] && source "~/.rvm/scripts/rvm"
export HISTFILE=~/.zsh_history
export HISTSIZE=10000
export HISTCONTROL=ignoredups
export SAVEHIST=10000
export PATH=.:/usr/local/bin:/usr/local/sbin:/usr/local/narwhal/bin:/bin:/sbin:/usr/bin:/usr/local/share:/usr/sbin:/usr/local/texlive/2011/bin/universal-darwin
export EDITOR='open -Wn'
export LC_TYPE=en_US.UTF-8
export LSCOLORS=exFxcxdxAxexbxHxGxcxBx
[ $UID = 0 ] && export PROMPT="%~ +=> " && export RPROMPT="%*"
[ $UID != 0 ] && export PROMPT="%~ => " && export RPROMPT="%*"
alias ..='cd ..'
alias ...='cd ../..'
alias internet='lsof -P -i -n | cut -f 1 -d " " | uniq'
alias restart='sudo shutdown -r NOW'
alias ls='ls -@1AFGph'
alias tree='tree -alCF --charset=UTF-8 --du --si'
alias mate='mate -w'
alias zshrc='$EDITOR ~/.zshrc && source ~/.zshrc'
alias vimrc='$EDITOR ~/.vimrc.local'
alias gvimrc='$EDITOR ~/.gvimrc.local'
[ $UID = 0 ] && \
alias rm='rm -i' && \
alias mv='mv -i' && \
alias cp='cp -i'
extract () {
if [ -f $1 ]; then
case $1 in
*.tar.bz2) tar -jxvf $1 ;;
*.tar.gz) tar -zxvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.dmg) hdiutul mount $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar -xvf $1 ;;
*.tbz2) tar -jxvf $1 ;;
*.tgz) tar -zxvf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted/mounted via extract()." ;;
esac
else
echo "'$1' is not a valid file."
fi
}
pman () {
man -t $@ | open -f -a /Applications/Preview.app
}
fp () {
ps Ao pid,comm|awk '{match($0,/[^\/]+$/); print substr($0,RSTART,RLENGTH)": "$1}'|grep -i $1|grep -v grep
}
fk () {
IFS=$'\n'
PS3='Kill which process? (1 to cancel): '
select OPT in "Cancel" $(fp $1); do
if [ $OPT != "Cancel" ]; then
kill $(echo $OPT|awk '{print $NF}')
fi
break
done
unset IFS
}
create () {
touch $1 && open $1
}
reset () {
cd ~/Desktop; clear
}
quit () {
killall Terminal
}
setopt \
AUTO_CD \
AUTO_PUSHD \
CD_ABLE_VARS \
CHASE_DOTS \
CHASE_LINKS \
setopt \
AUTO_LIST \
AUTO_MENU \
AUTO_PARAM_SLASH \
COMPLETE_IN_WORD \
LIST_TYPES \
MENU_COMPLETE \
REC_EXACT \
setopt \
APPEND_HISTORY \
EXTENDED_HISTORY \
setopt \
CORRECT \
setopt \
MULTIOS \
setopt \
NO_BEEP \
ZLE
bindkey "^[[3~" delete-char
autoload -U compinit && compinit -C && autoload -U zstyle+
zstyle ':completion:*' completer _complete _list _oldlist _expand _ignored _match _correct
zstyle ':completion:*::::' completer _expand _complete _ignored _approximate
zstyle ':completion:*' file-sort name
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' list-colors ${LSCOLORS}
zstyle ':completion:*:*:kill:*:processes' command 'ps -axco pid,user,command'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*' menu select=long
zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.(o|c~|old|pro|zwc)'
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path ~/.zcompcache/$HOST
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'
zstyle ':completion:*:expand:*' tag-order all-expansions
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
source
share