commit 3fea3af59b1bb17a6366e10a260fbfad577e91e0 Author: ray Date: Thu Feb 27 14:46:48 2020 +0000 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9117f02 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +zgen diff --git a/README.md b/README.md new file mode 100644 index 0000000..aff1916 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +When updating plugins must do a `zgen reset` to clear init script and then restart `zsh` to trigger changes. diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..201e15b --- /dev/null +++ b/zshrc @@ -0,0 +1,187 @@ +emulate sh +source "${HOME}/.profile" +emulate zsh + +autoload -Uz compinit +autoload -Uz colors +typeset -i updated_at=$(date +'%j' -r ~/.zcompdump 2>/dev/null || stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null) +if [ $(date +'%j') != $updated_at ]; then + compinit -i +else + compinit -C -i +fi + + +# zgen +# https://github.com/tarjoilija/zgen +# after changes must do: +# zgen reset +# to remove static init script + +source "${HOME}/.config/zsh/zgen/zgen.zsh" +# if the init script doesn't exist +if ! zgen saved; then + + # specify plugins here + # zgen oh-my-zsh + + zgen load denysdovhan/spaceship-prompt spaceship + zgen load zdharma/fast-syntax-highlighting + zgen load zsh-users/zsh-autosuggestions + zgen load zsh-users/zsh-history-substring-search + zgen load zsh-users/zsh-completions + zgen load wbingli/zsh-wakatime + zgen load peterhurford/up.zsh + zgen load supercrabtree/k + zgen load laggardkernel/git-ignore + zgen load AlexisBRENON/oh-my-zsh-reminder # commands todo, task_done -> todone + # zsh-fast-alias-tips + # Before using need to run 'make build' + # in plugin directory '~/.zgen/sei40kr/zsh-fast-alias-tips-master/' + # zgen load sei40kr/zsh-fast-alias-tips + + # generate the init script from plugins above + zgen save +fi + + +# HISTFILE=~/.histfile +# HISTSIZE=10000 +# SAVEHIST=$HISTSIZE + +setopt hist_ignore_all_dups # remove older duplicate entries from history +setopt hist_reduce_blanks # remove superfluous blanks from history items +setopt inc_append_history # save history entries as soon as they are entered +setopt share_history # share history between different instances of the shell + +setopt auto_cd # cd by typing directory name if it's not a command +setopt correct_all # autocorrect commands +setopt auto_list # automatically list choices on ambiguous completion +setopt auto_menu # automatically use menu completion +setopt always_to_end # move cursor to end if word had one match + +unsetopt BEEP + +zstyle ':completion:*' menu select # select completions with arrow keys +zstyle ':completion:*' group-name '' # group results by category +zstyle ':completion:::::' completer _expand _complete _ignored _approximate # enable approximate matches + +bindkey -v + + +# export PATH=~/.npm-global/bin:$PATH +# export PATH=$(ruby -r rubygems -e "puts Gem.user_dir")/bin:$PATH +# export PATH=/home/ray/.bin:$PATH + + + +# The following line was added by compinstall +zstyle :compinstall filename '/home/ray/.zshrc' +zmodload -i zsh/complist + + +zstyle ':completion:*' menu select +zmodload zsh/complist +# use the vi navigation keys in menu completion +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history + + +# zsh-history-subsrting-search settings +HISTORY_SUBSTRING_SEARCH_FUZZY=true +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down +bindkey '' history-substring-search-up +bindkey '' history-substring-search-down + + +# auto-ls settings +# AUTO_LS_COMMANDS=(ls) + +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=239' + +#zsh-autosuggestion settings +bindkey '^f' autosuggest-accept + + +SPACESHIP_TIME_SHOW=true +SPACESHIP_NODE_SYMBOL=node- +SPACESHIP_PACKAGE_PREFIX= +SPACESHIP_PACKAGE_SYMBOL=package.json: +SPACESHIP_DOCKER_SYMBOL=docker- +SPACESHIP_PHP_SYMBOL=php- +SPACESHIP_VENV_PREFIX=venv:\ +SPACESHIP_VENV_SYMBOL=venv- +SPACESHIP_VENV_COLOR=7 +SPACESHIP_EXIT_CODE_SHOW=true +SPACESHIP_EXIT_CODE_SYMBOL= +SPACESHIP_EXIT_CODE_COLOR=9 +SPACESHIP_VI_MODE_SHOW=false +SPACESHIP_VI_MODE_COLOR=2 +SPACESHIP_VI_MODE_INSERT=\>\ \> +SPACESHIP_VI_MODE_NORMAL=\-\-\- +SPACESHIP_TIME_COLOR=7 +SPACESHIP_EXEC_TIME_ELAPSED=1 +SPACESHIP_EXEC_TIME_COLOR=8 +SPACESHIP_DIR_TRUNC_PREFIX=.../ +SPACESHIP_DIR_TRUNC=0 +SPACESHIP_DIR_TRUNC_REPO=false +SPACESHIP_DIR_COLOR=13 +SPACESHIP_GIT_BRANCH_COLOR=12 +SPACESHIP_GIT_BRANCH_SUFFIX= +SPACESHIP_GIT_STATUS_PREFIX=\ +SPACESHIP_GIT_STATUS_SUFFIX=\ +SPACESHIP_GIT_STATUS_COLOR=6 +SPACESHIP_GIT_STATUS_COLOR=red +SPACESHIP_GIT_STATUS_UNTRACKED=?? +SPACESHIP_GIT_STATUS_ADDED=A +SPACESHIP_GIT_STATUS_MODIFIED=M +SPACESHIP_GIT_STATUS_RENAMED=R +SPACESHIP_GIT_STATUS_DELETED=D +SPACESHIP_GIT_STATUS_STASHED=S +SPACESHIP_GIT_STATUS_UNMERGED=U +SPACESHIP_GIT_STATUS_AHEAD=++ +SPACESHIP_GIT_STATUS_BEHIND=-- +SPACESHIP_GIT_STATUS_DIVERGED=v +SPACESHIP_PROMPT_PREFIXES_SHOW=false +SPACESHIP_PROMPT_SUFIXES_SHOW=false +SPACESHIP_DIR_TRUNC=0 +SPACESHIP_DIR_COLOR=7 +SPACESHIP_DIR_LOCK_COLOR=1 +SPACESHIP_CHAR_SYMBOL=\>\ +SPACESHIP_CHAR_COLOR_SUCCESS=2 +SPACESHIP_CHAR_COLOR_FAILURE=1 +SPACESHIP_JOBS_COLOR=13 +SPACESHIP_JOBS_SYMBOL=\<\<\< +SPACESHIP_JOBS_AMOUNT_PREFIX=\ +SPACESHIP_JOBS_AMOUNT_SUFFIX=\ +SPACESHIP_JOBS_AAMOUNT_THRESHOLD=1 + +SPACESHIP_RPROMPT_ORDER=( + time # Time stamps section + exit_code # Exit code section +) +SPACESHIP_PROMPT_ORDER=( + user # Username section + host # Hostname section + git # Git section (git_branch + git_status) + docker # Docker section + venv # virtualenv section + pyenv # Pyenv section + dir # Current directory section + exec_time # Execution time + # battery # Battery level and status + line_sep # Line break + jobs # Background jobs indicator + vi_mode # Vi-mode indicator + exit_code # Exit code section + char # Prompt character +) + +spaceship_vi_mode_disable + +alias todone='task_done' + +source /home/ray/.config/broot/launcher/bash/br