diff --git a/zsh/lib/aliases.zsh b/zsh/lib/aliases.zsh index 60b4237..4219af3 100644 --- a/zsh/lib/aliases.zsh +++ b/zsh/lib/aliases.zsh @@ -1,9 +1,6 @@ # Super user alias _='sudo' -# Show history -alias history='fc -l 1' - # List direcory contents alias l='ls -la' alias ll='ls -l' diff --git a/zsh/lib/completion.zsh b/zsh/lib/completion.zsh index 09f1f3b..290b8bf 100644 --- a/zsh/lib/completion.zsh +++ b/zsh/lib/completion.zsh @@ -1,75 +1,56 @@ # fixme - the load process here seems a bit bizarre - -unsetopt menu_complete # do not autoselect the first completion entry -unsetopt flowcontrol -setopt auto_menu # show completion menu on succesive tab press -setopt complete_in_word -setopt always_to_end +zmodload -i zsh/complist WORDCHARS='' -zmodload -i zsh/complist - -## case-insensitive (all),partial-word and then substring completion -if [ "x$CASE_SENSITIVE" = "xtrue" ]; then - zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - unset CASE_SENSITIVE -else - zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' -fi - -# uncomment if completion should be colorful -# zstyle ':completion:*' list-colors '' +unsetopt menu_complete # do not autoselect the first completion entry +unsetopt flowcontrol +setopt auto_menu # show completion menu on successive tab press +setopt complete_in_word +setopt always_to_end # should this be in keybindings? bindkey -M menuselect '^o' accept-and-infer-next-history - zstyle ':completion:*:*:*:*:*' menu select + +# case insensitive (all), partial-word and substring completion +if [[ "$CASE_SENSITIVE" = true ]]; then + zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*' +else + if [[ "$HYPHEN_INSENSITIVE" = true ]]; then + zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*' + else + zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' + fi +fi +unset CASE_SENSITIVE HYPHEN_INSENSITIVE + +zstyle ':completion:*' list-colors '' zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' -zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" + +if [[ "$OSTYPE" = solaris* ]]; then + zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm" +else + zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" +fi # disable named-directories autocompletion zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories -cdpath=(.) - -# use /etc/hosts and known_hosts for hostname completion -[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$( /dev/null) ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else @@ -12,8 +12,6 @@ parse_git_dirty () { fi } -# get the status of the working tree - # Aliases alias g='git' alias ga='git add .' diff --git a/zsh/lib/grep.zsh b/zsh/lib/grep.zsh index 93c4270..374279a 100644 --- a/zsh/lib/grep.zsh +++ b/zsh/lib/grep.zsh @@ -3,4 +3,4 @@ # Examples: http://rubyurl.com/ZXv # export GREP_OPTIONS='--color=auto' -export GREP_COLOR='1;32' \ No newline at end of file +export GREP_COLOR='1;32' diff --git a/zsh/lib/history.zsh b/zsh/lib/history.zsh index d514a02..bc150c6 100644 --- a/zsh/lib/history.zsh +++ b/zsh/lib/history.zsh @@ -3,6 +3,8 @@ HISTFILE=$HOME/.zsh_history HISTSIZE=5000 SAVEHIST=5000 +alias history='fc -El 1' # "dd.mm.yyyy" + setopt append_history setopt extended_history setopt hist_expire_dups_first diff --git a/zsh/lib/misc.zsh b/zsh/lib/misc.zsh index 10320f7..1862c44 100644 --- a/zsh/lib/misc.zsh +++ b/zsh/lib/misc.zsh @@ -2,9 +2,6 @@ autoload -U url-quote-magic zle -N self-insert url-quote-magic -## file rename magick -bindkey "^[m" copy-prev-shell-word - ## jobs setopt long_list_jobs @@ -12,4 +9,3 @@ setopt long_list_jobs export PAGER=less export LC_CTYPE=$LANG #export LC_CTYPE=de_DE.UTF-8 -