diff --git a/README.md b/README.md index 4dc8226..4db3bc2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # zsh-basics -Basic Options for zsh configuration \ No newline at end of file +Basic Options for zsh configuration. diff --git a/zsh-basics.plugin.zsh b/zsh-basics.plugin.zsh new file mode 100644 index 0000000..7799070 --- /dev/null +++ b/zsh-basics.plugin.zsh @@ -0,0 +1,80 @@ +unsetopt BEEP +unsetopt menu_complete +unsetopt flowcontrol +setopt always_to_end +setopt append_history +setopt auto_cd +setopt auto_list +setopt auto_menu +setopt auto_param_keys +setopt auto_param_slash +setopt complete_aliases +setopt complete_in_word +setopt extended_glob +setopt extended_history +setopt glob_dots +setopt inc_append_history +setopt interactive_comments +setopt list_packed +setopt list_types +setopt nomatch +setopt share_history + +zmodload -i zsh/complist + +zstyle ':completion:*:*:*:*:*' menu select +zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*' +zstyle ':completion:*' special-dirs true +zstyle ':completion:*' use-cache yes +zstyle ':completion:*' cache-path $ZSH_CACHE_DIR + +# Include hidden files. +_comp_options+=(globdots) +zle_highlight=('paste:none') + +HISTFILE="$HOME/.zsh_history" +SAVEHIST=10000 + +autoload -U up-line-or-beginning-search +autoload -U down-line-or-beginning-search +zle -N up-line-or-beginning-search +zle -N down-line-or-beginning-search + +# Colors +autoload -Uz colors && colors + +# exports +export PATH="$HOME/.local/bin":$PATH + +# bindings +bindkey -s '^x' '^usource ~/.zshrc\n' +bindkey "^[[H" beginning-of-line +bindkey "^[[F" end-of-line +bindkey "\e[3~" delete-char +bindkey "^[[3;5~" kill-word +bindkey ' ' magic-space +bindkey '^[[A' up-line-or-search +bindkey '^[[B' down-line-or-search + +# ls colors +case "$(uname -s)" in + +Darwin) + # echo 'Mac OS X' + alias ls='ls -G' + ;; + +Linux) + alias ls='ls --color=auto' + ;; + +CYGWIN* | MINGW32* | MSYS* | MINGW*) + # echo 'MS Windows' + ;; +*) + # echo 'Other OS' + ;; +esac + +# completions +autoload -Uz compinit && compinit