diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/aliases.zsh | 2 | ||||
-rw-r--r-- | lib/completion.zsh | 3 | ||||
-rw-r--r-- | lib/correction.zsh | 16 | ||||
-rw-r--r-- | lib/directories.zsh | 20 | ||||
-rw-r--r-- | lib/git.zsh | 16 | ||||
-rw-r--r-- | lib/rbenv.zsh | 2 | ||||
-rw-r--r-- | lib/termsupport.zsh | 6 |
7 files changed, 47 insertions, 18 deletions
diff --git a/lib/aliases.zsh b/lib/aliases.zsh index a7f699c19..2b58c4faa 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -17,7 +17,7 @@ alias history='fc -l 1' # List direcory contents alias lsa='ls -lah' -alias l='ls -lA1' +#alias l='ls -la' alias ll='ls -l' alias la='ls -lA' alias sl=ls # often screw this up diff --git a/lib/completion.zsh b/lib/completion.zsh index ba839a067..e0cdcf626 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -34,8 +34,10 @@ cdpath=(.) # use /etc/hosts and known_hosts for hostname completion [ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=() [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() +[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=() hosts=( + "$_ssh_config[@]" "$_global_ssh_hosts[@]" "$_ssh_hosts[@]" "$_etc_hosts[@]" @@ -43,6 +45,7 @@ hosts=( localhost ) zstyle ':completion:*:hosts' hosts $hosts +zstyle ':completion:*' users off # Use caching so that commands like apt and dpkg complete are useable zstyle ':completion::complete:*' use-cache 1 diff --git a/lib/correction.zsh b/lib/correction.zsh index 176ec16d5..436446101 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -1,2 +1,14 @@ -# correct commands, but not any arguments (correct_all would do that) -setopt correct +if [[ "$DISABLE_CORRECTION" == "true" ]]; then + return +else + setopt correct_all + alias man='nocorrect man' + alias mv='nocorrect mv' + alias mysql='nocorrect mysql' + alias mkdir='nocorrect mkdir' + alias gist='nocorrect gist' + alias heroku='nocorrect heroku' + alias ebuild='nocorrect ebuild' + alias hpodder='nocorrect hpodder' + alias sudo='nocorrect sudo' +fi diff --git a/lib/directories.zsh b/lib/directories.zsh index 6c743e40e..1896945f4 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -2,6 +2,7 @@ setopt auto_name_dirs setopt auto_pushd setopt pushd_ignore_dups +setopt pushdminus alias ..='cd ..' alias cd..='cd ..' @@ -11,14 +12,14 @@ alias cd.....='cd ../../../..' alias cd/='cd /' alias 1='cd -' -alias 2='cd +2' -alias 3='cd +3' -alias 4='cd +4' -alias 5='cd +5' -alias 6='cd +6' -alias 7='cd +7' -alias 8='cd +8' -alias 9='cd +9' +alias 2='cd -2' +alias 3='cd -3' +alias 4='cd -4' +alias 5='cd -5' +alias 6='cd -6' +alias 7='cd -7' +alias 8='cd -8' +alias 9='cd -9' cd () { if [[ "x$*" == "x..." ]]; then @@ -29,6 +30,9 @@ cd () { cd ../../../.. elif [[ "x$*" == "x......" ]]; then cd ../../../../.. + elif [ -d ~/.autoenv ]; then + source ~/.autoenv/activate.sh + autoenv_cd "$@" else builtin cd "$@" fi diff --git a/lib/git.zsh b/lib/git.zsh index 76fe9b142..c4b5b5d62 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -14,14 +14,20 @@ parse_git_dirty() { if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then if [[ $POST_1_7_2_GIT -gt 0 ]]; then SUBMODULE_SYNTAX="--ignore-submodules=dirty" - fi - GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1) - if [[ -n $GIT_STATUS && "$GIT_STATUS" != "$CLEAN_MESSAGE" ]]; then + fi + if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then + GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1) + else + GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1) + fi + if [[ -n $GIT_STATUS ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else echo "$ZSH_THEME_GIT_PROMPT_CLEAN" - fi - fi + fi + else + echo "$ZSH_THEME_GIT_PROMPT_CLEAN" + fi } # get the difference between the local and remote branches diff --git a/lib/rbenv.zsh b/lib/rbenv.zsh new file mode 100644 index 000000000..a8b6c323c --- /dev/null +++ b/lib/rbenv.zsh @@ -0,0 +1,2 @@ +# using the rbenv plugin will override this with a real implementation +function rbenv_prompt_info() {} diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index c056989eb..80319e1a8 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -8,7 +8,7 @@ function title { fi if [[ "$TERM" == screen* ]]; then print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars - elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then + elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then print -Pn "\e]2;$2:q\a" #set window name print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) fi @@ -27,7 +27,9 @@ function omz_termsupport_preexec { emulate -L zsh setopt extended_glob local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - title "$CMD" "%100>...>${2:gs/%/%%}%<<" + local LINE="${2:gs/$/\\$}" + LINE="${LINE:gs/%/%%}" + title "$CMD" "%100>...>$LINE%<<" } autoload -U add-zsh-hook |