├── .gitignore ├── README.md ├── dot.inputrc ├── dot.tmux.conf ├── dot.zshrc └── screenshots ├── Screenshot-20190613174734-654x440.png ├── Screenshot-20190613174821-654x440.png └── Screenshot-20190613175548-654x440.png /.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | 3 | My personal collection of various dotfiles 4 | 5 | ![main](screenshots/Screenshot-20190613175548-654x440.png?raw=true) 6 | 7 | a minimalistic tmux config 8 | 9 | ![tmux](screenshots/Screenshot-20190613174821-654x440.png?raw=true) 10 | 11 | pleasant colors for manpages 12 | 13 | ![manpage](screenshots/Screenshot-20190613174734-654x440.png?raw=true) 14 | -------------------------------------------------------------------------------- /dot.inputrc: -------------------------------------------------------------------------------- 1 | # Use vi editing mode 2 | #set editing-mode vi 3 | #set keymap vi 4 | 5 | # Set visible bell 6 | set bell-style visible # Options: none, visible, audible 7 | 8 | set keyseq-timeout 0 # The duration Readline will wait for a character 9 | 10 | # Adds punctuation as word delimiters 11 | set bind-tty-special-chars off 12 | 13 | # Completion Options 14 | set page-completions on # Page completions more like. 15 | set completion-ignore-case on # Ignore case 16 | set completion-query-items 200 # Show double the number of default completions. 17 | set match-hidden-files off # Don't match hidden files 18 | set show-all-if-ambiguous on # Enable single tab completion 19 | set show-all-if-unmodified on # List immediately, don't bell if ambigous. 20 | set visible-stats on # Show item type like 'ls -F', displays /,*,@ next to name 21 | set colored-stats on 22 | 23 | # Fix for accents input with UTF-8. 24 | set meta-flag on 25 | set input-meta on 26 | set output-meta on 27 | set convert-meta off 28 | 29 | $if mode=emacs 30 | # Readline specific functions 31 | "\e[1~": beginning-of-line # CTRL + A 32 | "\e[4~": end-of-line # CTRL + E 33 | "\e[5C": forward-word # Control + Right 34 | "\e[5D": backward-word # Control + Left 35 | "\e[3~": delete-char # Delete 36 | "\e[2~": quoted-insert # CTRL + v 37 | "\e[5~": history-search-backward # Page Up 38 | "\e[6~": history-search-forward # Page Down 39 | #"\t": menu-complete # Tab cycles through completions 40 | 41 | # Mappings for Alt/Ctrl left-arrow and right-arrow word moving 42 | # Alt-arrow 43 | "\e[1;3D": backward-word 44 | "\e[1;3C": forward-word 45 | 46 | # Ctrl-arrow 47 | "\e[1;5C": forward-word 48 | "\e[1;5D": backward-word 49 | 50 | # If the above prevents Left and Right from working, try this: 51 | #"\e[C": forward-char # Move forward one character. 52 | #"\e[D": backward-char # Move backwards one character. 53 | $endif 54 | 55 | # Avoid binding ^J, ^M, ^C, ^?, ^S, ^Q, etc. 56 | $if mode=vi 57 | set keymap vi-command 58 | "gg": beginning-of-history 59 | "G": end-of-history 60 | "k": history-search-backward 61 | "j": history-search-forward 62 | "?": reverse-search-history 63 | "/": forward-search-history 64 | 65 | set keymap vi-insert 66 | "\C-l": clear-screen 67 | "\C-w": backward-kill-word 68 | "\C-a": beginning-of-line 69 | "\C-e": end-of-line 70 | $endif 71 | -------------------------------------------------------------------------------- /dot.tmux.conf: -------------------------------------------------------------------------------- 1 | ## 2 | ## Basic Options 3 | ## 4 | 5 | # Mouse 6 | set -g mouse on 7 | 8 | # Enable status bar 9 | bind-key b set status 10 | 11 | 12 | ## 13 | ## Copy mode 14 | ## 15 | 16 | unbind [ 17 | bind Escape copy-mode 18 | setw -g mode-keys vi 19 | unbind p 20 | bind p paste-buffer 21 | bind-key -T copy-mode-vi 'v' send-keys -X begin-selection 22 | bind-key -T copy-mode-vi 'y' send-keys -X copy-selection 23 | 24 | 25 | ## 26 | ## Key bindings 27 | ## 28 | 29 | # Panel splites and selection 30 | bind-key -n C-\ last-window 31 | bind-key -n C-b previous-window 32 | bind-key -n C-n next-window 33 | bind n next-window 34 | bind b previous-window 35 | 36 | # Kill 37 | bind q kill-window 38 | bind Q kill-session 39 | 40 | ## 41 | ## Appearance 42 | ## 43 | 44 | # Status bar 45 | set -g status-position bottom 46 | set -g status-interval 4 47 | set -g status-left '' 48 | set -g status-right '' 49 | set -g status-justify left # center align window list 50 | 51 | setw -g status-bg default 52 | setw -g window-status-current-style fg=default,bg=default 53 | setw -g window-status-style fg=white,fg=default 54 | setw -g window-status-format '#[bg=black]#[fg=black,bold] #I #[bg=default] #[fg=black]#W ' 55 | setw -g window-status-current-format '#[fg=white]#[bg=cyan] #I #[fg=white]#[bg=default] #W ' 56 | 57 | # Panel borders 58 | set -g pane-active-border-style fg=cyan,bg=default 59 | set -g pane-border-style fg=black,bg=default 60 | 61 | # Message text 62 | set-option -g message-style fg=default,bg=default 63 | 64 | 65 | #-------------------------------------------------------# 66 | #PANE NAVIGATION/MANAGEMENT 67 | #-------------------------------------------------------# 68 | # splitting panes 69 | bind \ split-window -h -c '#{pane_current_path}' 70 | bind - split-window -v -c '#{pane_current_path}' 71 | 72 | # open new panes in current path 73 | bind c new-window -c '#{pane_current_path}' 74 | 75 | # Use Alt-arrow keys WITHOUT PREFIX KEY to switch panes 76 | bind -n M-Left select-pane -L 77 | bind -n M-Right select-pane -R 78 | bind -n M-Up select-pane -U 79 | bind -n M-Down select-pane -D 80 | 81 | # 82 | #https://stackoverflow.com/questions/42484934/set-default-color-theme-in-vim-under-tmux-cygwin-the-same-as-outside-tmux 83 | #Start windows at 1, not 0 84 | set -g base-index 1 85 | setw -g pane-base-index 1 86 | 87 | # Automatically set window title 88 | set-window-option -g automatic-rename on 89 | set-option -g set-titles on 90 | 91 | #set -g default-terminal screen-256color 92 | set -g status-keys vi 93 | set -g history-limit 10000 94 | 95 | setw -g mode-keys vi 96 | #setw -g mode-mouse on 97 | setw -g monitor-activity on 98 | 99 | # move to last active window 100 | bind-key Tab last-window 101 | 102 | bind-key v split-window -h 103 | bind-key s split-window -v 104 | 105 | bind-key -r Down resize-pane -D 2 106 | bind-key -r Up resize-pane -U 2 107 | bind-key -r Left resize-pane -L 2 108 | bind-key -r Right resize-pane -R 2 109 | 110 | # Use Alt-arrow keys without prefix key to switch panes 111 | bind -n M-Left select-pane -L 112 | bind -n M-Right select-pane -R 113 | bind -n M-Up select-pane -U 114 | bind -n M-Down select-pane -D 115 | 116 | bind > swap-pane -D # swap current pane with the next one 117 | bind < swap-pane -U # swap current pane with the previous one 118 | 119 | set -g status-interval 1 # redraw status line every second 120 | 121 | # No delay for escape key press 122 | set -sg escape-time 0 123 | 124 | set-option -g repeat-time 500 125 | 126 | # edit configuration 127 | bind-key e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR:-nvim} ~/.tmux.conf'" 128 | 129 | # reload configuration 130 | bind-key r source-file ~/.tmux.conf \; display '~/.tmux.conf reloaded' 131 | 132 | # Update the TERM variable when creating or attaching to a session 133 | set -g update-environment \ 134 | 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM' 135 | 136 | set-option -g default-terminal "tmux-256color" 137 | set-option -ga terminal-overrides ",xterm-256color:Tc" # true color support 138 | 139 | #bind-key Enter run-shell 'tmux choose-tree -Nwf"##{==:##{session_name},#{session_name}}"' 140 | 141 | bind-key m set-option -g mouse on \; display 'Mouse: ON' 142 | bind-key M set-option -g mouse off \; display 'Mouse: OFF' 143 | 144 | # Plugin list 145 | set -g @plugin 'tmux-plugins/tpm' 146 | set -g @plugin 'tmux-plugins/tmux-sensible' 147 | set -g @plugin 'tmux-plugins/tmux-cpu' 148 | set -g @plugin 'tmux-plugins/tmux-mem' 149 | set -g @plugin 'tmux-plugins/tmux-yank' 150 | set -g @plugin 'tmux-plugins/tmux-copycat' 151 | set -g @plugin 'nhdaly/tmux-better-mouse-mode' 152 | set -g @plugin 'odedlaz/tmux-status-variables' 153 | set -g @plugin 'tmux-plugins/tmux-prefix-highlight' 154 | 155 | set -g @scroll-down-exit-copy-mode "off" 156 | set -g @yank_selection 'clipboard' 157 | set -g @cpu_low_icon '▁' 158 | set -g @cpu_medium_icon '▃' 159 | set -g @cpu_high_icon '▇' 160 | 161 | # Don't show a message on a bell 162 | set -g visual-bell off 163 | 164 | # Don't actually ring the bell (but still set the window attributes in 165 | # the status bar so we know that a bell rang) 166 | set -g bell-action none 167 | set -g monitor-activity on 168 | 169 | # auto window rename 170 | set-option -g renumber-windows on 171 | 172 | set -g status-right '#{cpu_fg_color}#{cpu_percentage} #{cpu_icon}' 173 | #set -g status-left ' [#S] ' 174 | set -g status-left '' 175 | 176 | if "test ! -d ~/.tmux/plugins/tpm" \ 177 | "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" 178 | 179 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 180 | run '~/.tmux/plugins/tpm/tpm' 181 | -------------------------------------------------------------------------------- /dot.zshrc: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # Functions 3 | # ============================================================================= 4 | powerlevel9k_random_color(){ 5 | printf "%03d" $[${RANDOM}%234+16] #random between 16-250 6 | } 7 | 8 | zsh_wifi_signal(){ 9 | local signal=$(nmcli -t device wifi | grep '^*' | awk -F':' '{print $6}') 10 | local color="yellow" 11 | [[ $signal -gt 75 ]] && color="green" 12 | [[ $signal -lt 50 ]] && color="red" 13 | echo -n "%F{$color}\uf1eb" # \uf1eb is  14 | } 15 | 16 | function set_title(){ 17 | echo -ne "\033];$(hostname): $(pwd)\007" 18 | } 19 | 20 | # ============================================================================= 21 | # Variables 22 | # ============================================================================= 23 | # Common ENV variables 24 | export TERM="xterm-256color" 25 | export SHELL="/bin/zsh" 26 | export EDITOR="nvim" 27 | 28 | # Fix Locale 29 | export LANG="en_US.UTF-8" 30 | export LC_ALL="en_US.UTF-8" 31 | 32 | # History 33 | export HISTFILE="$HOME/.zsh_history" 34 | export HISTSIZE=10000 35 | export SAVEHIST=$HISTSIZE 36 | 37 | #export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:' 38 | 39 | # color formatting for man pages 40 | export LESS_TERMCAP_mb=$'\e[1;31m' # begin bold 41 | export LESS_TERMCAP_md=$'\e[1;36m' # begin blink 42 | export LESS_TERMCAP_so=$'\e[1;33;44m' # begin reverse video 43 | export LESS_TERMCAP_us=$'\e[1;37m' # begin underline 44 | export LESS_TERMCAP_me=$'\e[0m' # reset bold/blink 45 | export LESS_TERMCAP_se=$'\e[0m' # reset reverse video 46 | export LESS_TERMCAP_ue=$'\e[0m' # reset underline 47 | export GROFF_NO_SGR=1 # for konsole and gnome-terminal 48 | 49 | export MANPAGER='less -s -M -R +Gg' 50 | 51 | # Directory coloring 52 | if [[ $OSTYPE = (darwin|freebsd)* ]]; then 53 | #export CLICOLOR="YES" # Equivalent to passing -G to ls. 54 | #export LSCOLORS="exgxdHdHcxaHaHhBhDeaec" 55 | #export LS_OPTIONS='-G' 56 | export CLICOLOR=true 57 | export LSCOLORS='exfxcxdxbxGxDxabagacad' 58 | 59 | #[ -d "/opt/local/bin" ] && export PATH="/opt/local/bin:$PATH" 60 | 61 | ## Prefer GNU version, since it respects dircolors. 62 | #if (( $+commands[gls] )); then 63 | # alias ls='() { $(whence -p gls) -Ctr --file-type --color=auto $@ }' 64 | #else 65 | # alias ls='() { $(whence -p ls) -CFtr $@ }' 66 | #fi 67 | fi 68 | 69 | if [[ $OSTYPE = (linux)* ]]; then 70 | export LS_OPTIONS='--color=auto' 71 | fi 72 | 73 | # Common aliases 74 | alias rm="rm -v" 75 | alias cp="cp -v" 76 | alias mv="mv -v" 77 | alias ls="ls $LS_OPTIONS -hFtr" 78 | alias ll="ls $LS_OPTIONS -lAhFtr" 79 | alias ccat="pygmentize -O style=monokai -f 256 -g" 80 | alias dig="dig +nocmd any +multiline +noall +answer" 81 | 82 | disable -r time # disable shell reserved word 83 | alias time='time -p ' # -p for POSIX output 84 | 85 | # ============================================================================= 86 | # Plugins 87 | # ============================================================================= 88 | # Check if zplug is installed 89 | #[ ! -d ~/.zplug ] && git clone https://github.com/zplug/zplug ~/.zplug 90 | #source ~/.zplug/init.zsh 91 | 92 | # Check if zplug is installed 93 | if [[ ! -d ~/.zplug ]]; then 94 | git clone https://github.com/zplug/zplug ~/.zplug 95 | source ~/.zplug/init.zsh && zplug update 96 | zplug "zplug/zplug", hook-build:"zplug --self-manage" 97 | fi 98 | source ~/.zplug/init.zsh 99 | 100 | # zplug 101 | #zplug 'zplug/zplug', hook-build:'zplug --self-manage' 102 | #zplug 'themes/sorin', from:oh-my-zsh, as:theme 103 | 104 | # oh-my-zsh 105 | #zplug "robbyrussell/oh-my-zsh", use:"lib/*.zsh" 106 | 107 | # Load theme 108 | zplug "mafredri/zsh-async", from:github, use:async.zsh 109 | zplug "bhilburn/powerlevel9k", use:powerlevel9k.zsh-theme, from:github, at:next, as:theme 110 | #zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme 111 | #zplug "aaronjamesyoung/aaron-zsh-theme", use:aaron.zsh-theme, from:github, as:theme 112 | #zplug "gporrata/bklyn-zsh" 113 | 114 | #zplug "themes/spaceship", from:oh-my-zsh, as:theme 115 | #zplug "dracula/zsh", from:github, as:theme 116 | #zplug "geometry-zsh/geometry", from:github, as:theme 117 | #zplug "mafredri/zsh-async", from:github, use:async.zsh 118 | #zplug "sindresorhus/pure", use:pure.zsh, from:github, as:theme 119 | #zplug "eendroroy/alien", from:github, as:theme 120 | 121 | zplug "chrissicool/zsh-256color" 122 | zplug "mollifier/anyframe" 123 | 124 | # Miscellaneous commands 125 | zplug "zdharma/zsh-diff-so-fancy" 126 | 127 | #zplug "andrewferrier/fzf-z" 128 | zplug "k4rthik/git-cal", as:command 129 | zplug "peco/peco", as:command, from:gh-r, use:"*${(L)$(uname -s)}*amd64*" 130 | zplug "junegunn/fzf-bin", as:command, from:gh-r, rename-to:fzf, use:"*${(L)$(uname -s)}*amd64*" 131 | zplug "junegunn/fzf", use:"shell/*.zsh" 132 | #zplug "b4b4r07/easy-oneliner", if:"which fzf", on:"junegunn/fzf-bin" 133 | 134 | # Enhanced cd 135 | zplug "b4b4r07/enhancd", use:init.sh 136 | 137 | # Bookmarks and jump 138 | zplug "jocelynmallon/zshmarks" 139 | 140 | # Enhanced dir list with git features 141 | zplug "supercrabtree/k" 142 | 143 | # Jump back to parent directory 144 | zplug "tarrasch/zsh-bd" 145 | 146 | # Simple zsh calculator 147 | zplug "arzzen/calc.plugin.zsh" 148 | 149 | # Directory colors 150 | zplug "seebi/dircolors-solarized", ignore:"*", as:plugin 151 | zplug "pinelibg/dircolors-solarized-zsh" 152 | 153 | # ZSH history database 154 | HISTDB_TABULATE_CMD=(sed -e $'s/\x1f/\t/g') 155 | #zplug "larkery/zsh-histdb", use:sqlite-history.zsh, hook-load:"histdb-update-outcome" 156 | zplug "larkery/zsh-histdb", use:"{sqlite-history,histdb-interactive}.zsh", hook-load:"histdb-update-outcome" 157 | 158 | zplug "zdharma/fast-syntax-highlighting" 159 | 160 | zplug "plugins/common-aliase", from:oh-my-zsh 161 | zplug "plugins/command-not-found", from:oh-my-zsh 162 | zplug "plugins/copydir", from:oh-my-zsh 163 | zplug "plugins/copyfile", from:oh-my-zsh 164 | zplug "plugins/cp", from:oh-my-zsh 165 | zplug "plugins/dircycle", from:oh-my-zsh 166 | zplug "plugins/encode64", from:oh-my-zsh 167 | zplug "plugins/extract", from:oh-my-zsh 168 | zplug "plugins/history", from:oh-my-zsh 169 | zplug "plugins/tmux", from:oh-my-zsh 170 | zplug "plugins/tmuxinator", from:oh-my-zsh 171 | zplug "plugins/urltools", from:oh-my-zsh 172 | zplug "plugins/web-search", from:oh-my-zsh 173 | zplug "plugins/z", from:oh-my-zsh 174 | zplug "plugins/fancy-ctrl-z", from:oh-my-zsh 175 | 176 | # Supports oh-my-zsh plugins and the like 177 | if [[ $OSTYPE = (linux)* ]]; then 178 | zplug "plugins/archlinux", from:oh-my-zsh, if:"(( $+commands[pacman] ))" 179 | zplug "plugins/dnf", from:oh-my-zsh, if:"(( $+commands[dnf] ))" 180 | zplug "plugins/mock", from:oh-my-zsh, if:"(( $+commands[mock] ))" 181 | fi 182 | 183 | if [[ $OSTYPE = (darwin)* ]]; then 184 | zplug "lib/clipboard", from:oh-my-zsh 185 | zplug "plugins/osx", from:oh-my-zsh 186 | zplug "plugins/brew", from:oh-my-zsh, if:"(( $+commands[brew] ))" 187 | zplug "plugins/macports", from:oh-my-zsh, if:"(( $+commands[port] ))" 188 | fi 189 | 190 | zplug "plugins/git", from:oh-my-zsh, if:"(( $+commands[git] ))" 191 | zplug "plugins/golang", from:oh-my-zsh, if:"(( $+commands[go] ))" 192 | zplug "plugins/svn", from:oh-my-zsh, if:"(( $+commands[svn] ))" 193 | zplug "plugins/node", from:oh-my-zsh, if:"(( $+commands[node] ))" 194 | zplug "plugins/npm", from:oh-my-zsh, if:"(( $+commands[npm] ))" 195 | zplug "plugins/bundler", from:oh-my-zsh, if:"(( $+commands[bundler] ))" 196 | zplug "plugins/gem", from:oh-my-zsh, if:"(( $+commands[gem] ))" 197 | zplug "plugins/rvm", from:oh-my-zsh, if:"(( $+commands[rvm] ))" 198 | zplug "plugins/pip", from:oh-my-zsh, if:"(( $+commands[pip] ))" 199 | zplug "plugins/sudo", from:oh-my-zsh, if:"(( $+commands[sudo] ))" 200 | zplug "plugins/gpg-agent", from:oh-my-zsh, if:"(( $+commands[gpg-agent] ))" 201 | zplug "plugins/systemd", from:oh-my-zsh, if:"(( $+commands[systemctl] ))" 202 | zplug "plugins/docker", from:oh-my-zsh, if:"(( $+commands[docker] ))" 203 | zplug "plugins/docker-compose", from:oh-my-zsh, if:"(( $+commands[docker-compose] ))" 204 | zplug "plugins/terraform", from:oh-my-zsh, if:"(( $+commands[terraform] ))" 205 | zplug "plugins/vagrant", from:oh-my-zsh, if:"(( $+commands[vagrant] ))" 206 | 207 | #zplug "djui/alias-tips" 208 | zplug "hlissner/zsh-autopair", defer:2 209 | zplug "zsh-users/zsh-completions" 210 | zplug "zsh-users/zsh-autosuggestions" 211 | # zsh-syntax-highlighting must be loaded after executing compinit command 212 | # and sourcing other plugins 213 | zplug "zsh-users/zsh-syntax-highlighting", defer:2 214 | zplug "zsh-users/zsh-history-substring-search", defer:3 215 | 216 | # ============================================================================= 217 | # Options 218 | # ============================================================================= 219 | autoload -Uz add-zsh-hook 220 | #autoload -Uz compinit && compinit -u 221 | #autoload -Uz url-quote-magic 222 | #autoload -Uz vcs_info 223 | 224 | # required for zsh-histdb 225 | #autoload -Uz add-zsh-hook 226 | #add-zsh-hook precmd histdb-update-outcome 227 | 228 | #autoload -U add-zsh-hook 229 | #add-zsh-hook precmd theme_precmd 230 | 231 | #zle -N self-insert url-quote-magic 232 | 233 | setopt autocd # Allow changing directories without `cd` 234 | setopt append_history # Dont overwrite history 235 | setopt auto_list 236 | setopt auto_menu 237 | setopt auto_pushd 238 | setopt extended_history # Also record time and duration of commands. 239 | setopt hist_expire_dups_first # Clear duplicates when trimming internal hist. 240 | setopt hist_find_no_dups # Dont display duplicates during searches. 241 | setopt hist_ignore_dups # Ignore consecutive duplicates. 242 | setopt hist_ignore_all_dups # Remember only one unique copy of the command. 243 | setopt hist_reduce_blanks # Remove superfluous blanks. 244 | setopt hist_save_no_dups # Omit older commands in favor of newer ones. 245 | setopt hist_ignore_space # Ignore commands that start with space. 246 | #setopt hist_ignore_all_dups 247 | #setopt hist_ignore_dups 248 | #setopt hist_reduce_blanks 249 | #setopt hist_save_no_dups 250 | #setopt ignore_eof 251 | setopt inc_append_history 252 | setopt interactive_comments 253 | setopt no_beep 254 | setopt no_hist_beep 255 | setopt no_list_beep 256 | setopt magic_equal_subst 257 | setopt notify 258 | setopt print_eight_bit 259 | setopt print_exit_value 260 | setopt prompt_subst 261 | setopt pushd_ignore_dups 262 | #setopt rm_star_wait 263 | setopt share_history # Share history between multiple shells 264 | setopt transient_rprompt 265 | 266 | ## Changing directories 267 | #setopt auto_pushd 268 | #setopt pushd_ignore_dups # Dont push copies of the same dir on stack. 269 | #setopt pushd_minus # Reference stack entries with "-". 270 | # 271 | #setopt extended_glob 272 | 273 | bindkey -v 274 | bindkey -v '^?' backward-delete-char 275 | bindkey '^[[Z' reverse-menu-complete 276 | #bindkey '^@' anyframe-widget-cd-ghq-repository 277 | #bindkey '^r' anyframe-widget-put-history 278 | 279 | #cp() { 280 | # command cp --reflink=auto "$@" 281 | #} 282 | 283 | #function cd() { 284 | # builtin cd $@ && ls; 285 | #} 286 | 287 | function history() { 288 | #rg --smart-case --colors 'path:fg:yellow' --vimgrep -o '[^;]*$' ~/.zsh_history 289 | #rg --smart-case --vimgrep -p -o '[^;]*$' ~/.zsh_history 290 | rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" --vimgrep -o '[^;]*$' ~/.zsh_history 291 | } 292 | 293 | # Watching other users 294 | #WATCHFMT="%n %a %l from %m at %t." 295 | watch=(notme) # Report login/logout events for everybody except ourself. 296 | LOGCHECK=60 # Time (seconds) between checks for login/logout activity. 297 | REPORTTIME=5 # Display usage statistics for commands running > 5 sec. 298 | 299 | # Key timeout and character sequences 300 | KEYTIMEOUT=1 301 | WORDCHARS='*?_-[]~=./&;!#$%^(){}<>' 302 | 303 | #zshaddhistory() { whence ${${(z)1}[1]} >| /dev/null || return 1 } 304 | 305 | # ============================================================================= 306 | # Key Bindings 307 | # ============================================================================= 308 | 309 | # Common CTRL bindings. 310 | bindkey "^a" beginning-of-line 311 | bindkey "^e" end-of-line 312 | bindkey "^f" forward-word 313 | bindkey "^b" backward-word 314 | bindkey "^k" kill-line 315 | bindkey "^d" delete-char 316 | bindkey "^y" accept-and-hold 317 | bindkey "^w" backward-kill-word 318 | bindkey "^u" backward-kill-line 319 | bindkey "^R" history-incremental-pattern-search-backward 320 | bindkey "^F" history-incremental-pattern-search-forward 321 | 322 | # Do not require a space when attempting to tab-complete. 323 | bindkey "^i" expand-or-complete-prefix 324 | 325 | # Fixes for alt-backspace and arrows keys 326 | bindkey '^[^?' backward-kill-word 327 | bindkey "^[[1;5C" forward-word 328 | bindkey "^[[1;5D" backward-word 329 | #bindkey "^[[C" forward-word 330 | #bindkey "^[[D" backward-word 331 | 332 | ## Emulate tcsh's backward-delete-word 333 | #tcsh-backward-kill-word () { 334 | # local WORDCHARS="${WORDCHARS:s#/#}" 335 | # zle backward-kill-word 336 | #} 337 | #zle -N tcsh-backward-kill-word 338 | 339 | # https://github.com/sickill/dotfiles/blob/master/.zsh.d/key-bindings.zsh 340 | tcsh-backward-word () { 341 | local WORDCHARS="${WORDCHARS:s#./#}" 342 | zle emacs-backward-word 343 | } 344 | zle -N tcsh-backward-word 345 | bindkey '\e[1;3D' tcsh-backward-word 346 | bindkey '\e^[[D' tcsh-backward-word # tmux 347 | 348 | tcsh-forward-word () { 349 | local WORDCHARS="${WORDCHARS:s#./#}" 350 | zle emacs-forward-word 351 | } 352 | zle -N tcsh-forward-word 353 | bindkey '\e[1;3C' tcsh-forward-word 354 | bindkey '\e^[[C' tcsh-backward-word # tmux 355 | 356 | tcsh-backward-delete-word () { 357 | local WORDCHARS="${WORDCHARS:s#./#}" 358 | zle backward-delete-word 359 | } 360 | zle -N tcsh-backward-delete-word 361 | bindkey "^[^?" tcsh-backward-delete-word # urxvt 362 | 363 | # ============================================================================= 364 | # Startup 365 | # ============================================================================= 366 | 367 | # Load SSH and GPG agents via keychain. 368 | #setup_agents() { 369 | # [[ $UID -eq 0 ]] && return 370 | # 371 | # if (( $+commands[keychain] )); then 372 | # local -a ssh_keys gpg_keys 373 | # for i in ~/.ssh/**/*pub; do test -f "$i(.N:r)" && ssh_keys+=("$i(.N:r)"); done 374 | # gpg_keys=$(gpg -K --with-colons 2>/dev/null | awk -F : '$1 == "sec" { print $5 }') 375 | # if (( $#ssh_keys > 0 )) || (( $#gpg_keys > 0 )); then 376 | # alias run_agents='() { $(whence -p keychain) --quiet --eval --inherit any-once --agents ssh,gpg $ssh_keys ${(f)gpg_keys} }' 377 | # [[ -t ${fd:-0} || -p /dev/stdin ]] && eval `run_agents` 378 | # unalias run_agents 379 | # fi 380 | # fi 381 | #} 382 | #setup_agents 383 | #unfunction setup_agents 384 | 385 | [ -d "$HOME/bin" ] && export PATH="$HOME/bin:$PATH" 386 | DIRCOLORS_SOLARIZED_ZSH_THEME="256dark" 387 | 388 | # Install plugins if there are plugins that have not been installed 389 | if ! zplug check; then 390 | printf "Install plugins? [y/N]: " 391 | if read -q; then 392 | echo; zplug install 393 | fi 394 | fi 395 | 396 | if zplug check "larkery/zsh-histdb"; then 397 | if [ ! -f "$HOME/.histdb/zsh-history.db" ]; then 398 | echo "Import your old zsh history with github.com/drewis/go-histdbimport" 399 | fi 400 | 401 | #_zsh_autosuggest_strategy_histdb_top_here() { 402 | # local query="select commands.argv from 403 | #history left join commands on history.command_id = commands.rowid 404 | #left join places on history.place_id = places.rowid 405 | #where places.dir LIKE '$(sql_escape $PWD)%' 406 | #and commands.argv LIKE '$(sql_escape $1)%' 407 | #group by commands.argv order by count(*) desc limit 1" 408 | # suggestion=$(_histdb_query "$query") 409 | #} 410 | #ZSH_AUTOSUGGEST_STRATEGY=histdb_top_here 411 | 412 | #bindkey '^r' _histdb-isearch 413 | fi 414 | 415 | if zplug check "junegunn/fzf-bin"; then 416 | export FZF_DEFAULT_OPTS="--height 40% --reverse --border --inline-info --color=dark,bg+:235,hl+:10,pointer:5" 417 | fi 418 | 419 | if zplug check "sindresorhus/pure"; then 420 | PURE_CMD_MAX_EXEC_TIME=0 421 | PURE_PROMPT_SYMBOL="%F{124}➜ %f" 422 | #PURE_PROMPT_SYMBOL="%F{124}⇢ %f" 423 | fi 424 | 425 | if zplug check "geometry-zsh/geometry"; then 426 | GEOMETRY_PROMPT_PLUGINS=(git exec_time) 427 | 428 | GEOMETRY_COLOR_EXIT_VALUE="magenta" # prompt symbol color when exit value is != 0 429 | 430 | PROMPT_GEOMETRY_EXEC_TIME=true 431 | PROMPT_GEOMETRY_COMMAND_MAX_EXEC_TIME=0 432 | 433 | PROMPT_GEOMETRY_COLORIZE_ROOT=true 434 | PROMPT_GEOMETRY_RPROMPT_ASYNC=true 435 | PROMPT_GEOMETRY_COLORIZE_SYMBOL=true 436 | fi 437 | 438 | if zplug check "mollifier/anyframe"; then 439 | # expressly specify to use peco 440 | #zstyle ":anyframe:selector:" use peco 441 | # expressly specify to use percol 442 | #zstyle ":anyframe:selector:" use percol 443 | # expressly specify to use fzf-tmux 444 | #zstyle ":anyframe:selector:" use fzf-tmux 445 | # expressly specify to use fzf 446 | zstyle ":anyframe:selector:" use fzf 447 | 448 | # specify path and options for peco, percol, or fzf 449 | #zstyle ":anyframe:selector:peco:" command 'peco --no-ignore-case' 450 | #zstyle ":anyframe:selector:percol:" command 'percol --case-sensitive' 451 | #zstyle ":anyframe:selector:fzf-tmux:" command 'fzf-tmux --extended' 452 | #zstyle ":anyframe:selector:fzf:" command 'fzf --extended' 453 | #zstyle ":anyframe:selector:fzf:" command 'fzf' 454 | 455 | #bindkey '^@' anyframe-widget-cd-ghq-repository 456 | #bindkey '^r' anyframe-widget-put-history 457 | fi 458 | 459 | if zplug check "zsh-users/zsh-history-substring-search"; then 460 | zmodload zsh/terminfo 461 | bindkey "$terminfo[kcuu1]" history-substring-search-up 462 | bindkey "$terminfo[kcud1]" history-substring-search-down 463 | bindkey "^[[1;5A" history-substring-search-up 464 | bindkey "^[[1;5B" history-substring-search-down 465 | fi 466 | 467 | if zplug check "zsh-users/zsh-syntax-highlighting"; then 468 | typeset -gA ZSH_HIGHLIGHT_STYLES ZSH_HIGHLIGHT_PATTERNS 469 | 470 | ZSH_HIGHLIGHT_STYLES[cursor]=fg=yellow,bold 471 | ZSH_HIGHLIGHT_STYLES[default]=none 472 | ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=green,bold 473 | ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=green,bold 474 | ZSH_HIGHLIGHT_STYLES[alias]=fg=cyan,bold 475 | ZSH_HIGHLIGHT_STYLES[builtin]=fg=cyan,bold 476 | ZSH_HIGHLIGHT_STYLES[function]=fg=cyan,bold 477 | ZSH_HIGHLIGHT_STYLES[command]=fg=white,bold 478 | ZSH_HIGHLIGHT_STYLES[precommand]=fg=white,underline 479 | ZSH_HIGHLIGHT_STYLES[commandseparator]=none 480 | ZSH_HIGHLIGHT_STYLES[hashed-command]=fg=green,bold 481 | ZSH_HIGHLIGHT_STYLES[path]=fg=214,underline 482 | ZSH_HIGHLIGHT_STYLES[globbing]=fg=063 483 | ZSH_HIGHLIGHT_STYLES[history-expansion]=fg=white,underline 484 | ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=fg=070 485 | ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=fg=070 486 | ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=none 487 | ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=063 488 | ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=063 489 | ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=009 490 | ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=009 491 | ZSH_HIGHLIGHT_STYLES[assign]=none 492 | 493 | ## Override highlighter colors 494 | #ZSH_HIGHLIGHT_STYLES[default]=none 495 | #ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=009 496 | #ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=009,standout 497 | #ZSH_HIGHLIGHT_STYLES[alias]=fg=white,bold 498 | #ZSH_HIGHLIGHT_STYLES[builtin]=fg=white,bold 499 | #ZSH_HIGHLIGHT_STYLES[function]=fg=white,bold 500 | #ZSH_HIGHLIGHT_STYLES[command]=fg=white,bold 501 | #ZSH_HIGHLIGHT_STYLES[precommand]=fg=white,underline 502 | #ZSH_HIGHLIGHT_STYLES[commandseparator]=none 503 | #ZSH_HIGHLIGHT_STYLES[hashed-command]=fg=009 504 | #ZSH_HIGHLIGHT_STYLES[path]=fg=214,underline 505 | #ZSH_HIGHLIGHT_STYLES[globbing]=fg=063 506 | #ZSH_HIGHLIGHT_STYLES[history-expansion]=fg=white,underline 507 | ##ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=fg=green 508 | ##ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=fg=green 509 | #ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=fg=070 510 | #ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=fg=070 511 | #ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=none 512 | #ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=063 513 | #ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=063 514 | #ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=009 515 | #ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=009 516 | #ZSH_HIGHLIGHT_STYLES[assign]=none 517 | 518 | #ZSH_HIGHLIGHT_STYLES[path]='fg=underline' 519 | #ZSH_HIGHLIGHT_STYLES[default]='none' 520 | #ZSH_HIGHLIGHT_STYLES[cursor]='fg=yellow' 521 | #ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red' 522 | #ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow' 523 | #ZSH_HIGHLIGHT_STYLES[alias]='fg=cyan' 524 | #ZSH_HIGHLIGHT_STYLES[builtin]='fg=cyan' 525 | #ZSH_HIGHLIGHT_STYLES[function]='fg=cyan' 526 | #ZSH_HIGHLIGHT_STYLES[command]='fg=cyan' 527 | #ZSH_HIGHLIGHT_STYLES[precommand]='fg=green' 528 | #ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=yellow' 529 | #ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green' 530 | #ZSH_HIGHLIGHT_STYLES[path]='fg=white,underline' 531 | #ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=grey,underline' 532 | #ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=white' 533 | #ZSH_HIGHLIGHT_STYLES[path_approx]='fg=white' 534 | #ZSH_HIGHLIGHT_STYLES[globbing]='none' 535 | #ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=green' 536 | #ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue,bold' 537 | #ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue,bold' 538 | #ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='none' 539 | #ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=magenta,bold' 540 | #ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=magenta,bold' 541 | #ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan' 542 | #ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan' 543 | #ZSH_HIGHLIGHT_STYLES[redirection]='fg=magenta' 544 | #ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=cyan,bold' 545 | #ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=green,bold' 546 | #ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=magenta,bold' 547 | #ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=yellow,bold' 548 | #ZSH_HIGHLIGHT_STYLES[assign]='none' 549 | 550 | ZSH_HIGHLIGHT_PATTERNS=('rm -rf *' 'fg=white,bold,bg=red') 551 | 552 | ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor line) 553 | fi 554 | 555 | if zplug check "zsh-users/zsh-autosuggestions"; then 556 | #ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10' 557 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=075' 558 | #ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=162' 559 | 560 | fi 561 | 562 | if zplug check "b4b4r07/enhancd"; then 563 | ENHANCD_FILTER="fzf:peco:percol" 564 | ENHANCD_COMMAND="c" 565 | fi 566 | 567 | if zplug check "b4b4r07/zsh-history-enhanced"; then 568 | ZSH_HISTORY_FILE="$HISTFILE" 569 | ZSH_HISTORY_FILTER="fzf:peco:percol" 570 | ZSH_HISTORY_KEYBIND_GET_BY_DIR="^r" 571 | ZSH_HISTORY_KEYBIND_GET_ALL="^r^a" 572 | fi 573 | 574 | if zplug check "denysdovhan/spaceship-prompt"; then 575 | SPACESHIP_PROMPT_ORDER=( 576 | # time # Time stampts section (Disabled) 577 | user # Username section 578 | dir # Current directory section 579 | host # Hostname section 580 | git # Git section (git_branch + git_status) 581 | exec_time # Execution time 582 | line_sep # Line break 583 | battery # Battery level and status 584 | jobs # Background jobs indicator 585 | char # Prompt character 586 | ) 587 | 588 | SPACESHIP_RPROMPT_ORDER=( 589 | exit_code # Exit code section 590 | time 591 | ) 592 | 593 | SPACESHIP_TIME_SHOW=true 594 | SPACESHIP_EXIT_CODE_SHOW=true 595 | 596 | SPACESHIP_PROMPT_SEPARATE_LINE=false 597 | SPACESHIP_PROMPT_ADD_NEWLINE=true 598 | 599 | #SPACESHIP_PROMPT_SEPARATE_LINE=false 600 | #SPACESHIP_PROMPT_FIRST_PREFIX_SHOW=true 601 | 602 | #PROMPT='%F{red}%n%f@%F{blue}%m%f %F{yellow}%1~%f %# ' 603 | #RPROMPT='[%F{yellow}%?%f]' 604 | fi 605 | 606 | if zplug check "bhilburn/powerlevel9k"; then 607 | #DEFAULT_USER=$USER 608 | 609 | # Easily switch primary foreground/background colors 610 | #DEFAULT_FOREGROUND=038 DEFAULT_BACKGROUND=024 PROMPT_COLOR=038 611 | 612 | DEFAULT_FOREGROUND=006 DEFAULT_BACKGROUND=235 PROMPT_COLOR=173 613 | DEFAULT_FOREGROUND=198 DEFAULT_BACKGROUND=090 PROMPT_COLOR=173 614 | DEFAULT_FOREGROUND=235 DEFAULT_BACKGROUND=159 PROMPT_COLOR=173 615 | DEFAULT_FOREGROUND=123 DEFAULT_BACKGROUND=059 PROMPT_COLOR=183 616 | DEFAULT_FOREGROUND=159 DEFAULT_BACKGROUND=238 PROMPT_COLOR=173 617 | DEFAULT_FOREGROUND=159 DEFAULT_BACKGROUND=239 PROMPT_COLOR=172 618 | #DEFAULT_COLOR=$DEFAULT_FOREGROUND 619 | DEFAULT_COLOR="clear" 620 | 621 | P9K_MODE="nerdfont-complete" 622 | P9K_STATUS_VERBOSE=false 623 | P9K_DIR_SHORTEN_LENGTH=1 624 | #P9K_SHORTEN_STRATEGY="truncate_right" 625 | 626 | P9K_DIR_OMIT_FIRST_CHARACTER=false 627 | 628 | P9K_CONTEXT_ALWAYS_SHOW=true 629 | P9K_CONTEXT_ALWAYS_SHOW_USER=false 630 | 631 | #P9K_CONTEXT_TEMPLATE="\uF109 %m" 632 | 633 | #P9K_LEFT_SUBSEGMENT_SEPARATOR="%F{$(( $DEFAULT_BACKGROUND - 2 ))}|%f" 634 | #P9K_RIGHT_SUBSEGMENT_SEPARATOR="%F{$(( $DEFAULT_BACKGROUND - 2 ))}|%f" 635 | 636 | #P9K_LEFT_SUBSEGMENT_SEPARATOR="%F{$DEFAULT_BACKGROUND}\ue0b0%f" 637 | #P9K_RIGHT_SUBSEGMENT_SEPARATOR="%F{$DEFAULT_BACKGROUND}\ue0b2%f" 638 | P9K_LEFT_SUBSEGMENT_SEPARATOR_ICON="%F{232}\uE0BD%f" 639 | P9K_RIGHT_SUBSEGMENT_SEPARATOR_ICON="%F{232}\uE0BD%f" 640 | #P9K_RIGHT_SUBSEGMENT_SEPARATOR="%F{000}%f" 641 | #P9K_LEFT_SUBSEGMENT_SEPARATOR="%F{000}/%f" #  642 | #P9K_RIGHT_SUBSEGMENT_SEPARATOR="%F{000}/%f" # 643 | #P9K_LEFT_SUBSEGMENT_SEPARATOR="%F{$(( $DEFAULT_BACKGROUND - 3 ))}/%f" 644 | #P9K_RIGHT_SUBSEGMENT_SEPARATOR="%F{$(( $DEFAULT_BACKGROUND - 3 ))}/%f" 645 | #P9K_LEFT_SUBSEGMENT_SEPARATOR="%F{$DEFAULT_FOREGROUND}\uE0B0%f" 646 | #P9K_RIGHT_SUBSEGMENT_SEPARATOR="%F{$DEFAULT_FOREGROUND}\uE0B3%f" 647 | 648 | #P9K_LEFT_SEGMENT_SEPARATOR="\uE0B4" 649 | #P9K_RIGHT_SEGMENT_SEPARATOR="\uE0B6" 650 | P9K_LEFT_SEGMENT_SEPARATOR_ICON='▓▒░' 651 | P9K_RIGHT_SEGMENT_SEPARATOR_ICON='░▒▓' 652 | #P9K_LEFT_SEGMENT_SEPARATOR="\uE0BC\u200A" 653 | #P9K_RIGHT_SEGMENT_SEPARATOR="\u200A\uE0BA" 654 | #P9K_LEFT_SEGMENT_SEPARATOR="\uE0BC" 655 | #P9K_RIGHT_SEGMENT_SEPARATOR="\uE0BA" 656 | #P9K_LEFT_SEGMENT_SEPARATOR="%F{$DEFAULT_BACKGROUND}\uE0BC%f" 657 | #P9K_RIGHT_SEGMENT_SEPARATOR="%F{$DEFAULT_BACKGROUND}\uE0BA%f" 658 | 659 | P9K_PROMPT_ON_NEWLINE=true 660 | P9K_RPROMPT_ON_NEWLINE=false 661 | 662 | P9K_STATUS_VERBOSE=true 663 | P9K_STATUS_CROSS=true 664 | P9K_PROMPT_ADD_NEWLINE=true 665 | 666 | P9K_MULTILINE_FIRST_PROMPT_PREFIX_ICON="%F{$PROMPT_COLOR}%f" 667 | P9K_MULTILINE_LAST_PROMPT_PREFIX_ICON="%F{$PROMPT_COLOR}➜ %f" 668 | #P9K_MULTILINE_LAST_PROMPT_PREFIX_ICON="%F{$PROMPT_COLOR}⇢ ➜ %f" 669 | #P9K_MULTILINE_LAST_PROMPT_PREFIX_ICON="%F{$PROMPT_COLOR} ┄⇢ %f" 670 | 671 | # P9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir_writable dir vcs) 672 | # P9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs time ssh) 673 | 674 | #P9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir_writable dir_joined vcs) 675 | #P9K_LEFT_PROMPT_ELEMENTS=(context dir_writable dir_joined vcs) 676 | #P9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator exec_time background_jobs time) 677 | P9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir dir_writable vcs) 678 | P9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs command_execution_time time) 679 | 680 | P9K_MODE='nerdfont-complete' 681 | 682 | P9K_VCS_GIT_GITHUB_ICON="" 683 | P9K_VCS_GIT_BITBUCKET_ICON="" 684 | P9K_VCS_GIT_GITLAB_ICON="" 685 | P9K_VCS_GIT_ICON="" 686 | 687 | P9K_VCS_CLEAN_BACKGROUND="$DEFAULT_BACKGROUND" 688 | P9K_VCS_CLEAN_FOREGROUND="010" 689 | 690 | P9K_VCS_MODIFIED_BACKGROUND="$DEFAULT_BACKGROUND" 691 | P9K_VCS_MODIFIED_FOREGROUND="011" 692 | 693 | P9K_VCS_UNTRACKED_BACKGROUND="$DEFAULT_BACKGROUND" 694 | #P9K_VCS_UNTRACKED_FOREGROUND="012" 695 | P9K_VCS_UNTRACKED_FOREGROUND="011" 696 | 697 | P9K_VCS_SHORTEN_STRATEGY="truncate_middle" 698 | 699 | P9K_DIR_HOME_BACKGROUND="$DEFAULT_BACKGROUND" 700 | P9K_DIR_HOME_FOREGROUND="158" 701 | P9K_DIR_HOME_SUBFOLDER_BACKGROUND="$DEFAULT_BACKGROUND" 702 | P9K_DIR_HOME_SUBFOLDER_FOREGROUND="158" 703 | P9K_DIR_WRITABLE_FORBIDDEN_BACKGROUND="$DEFAULT_BACKGROUND" 704 | #P9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="red" 705 | P9K_DIR_DEFAULT_BACKGROUND="$DEFAULT_BACKGROUND" 706 | P9K_DIR_DEFAULT_FOREGROUND="158" 707 | P9K_DIR_ETC_BACKGROUND="$DEFAULT_BACKGROUND" 708 | P9K_DIR_ETC_FOREGROUND="158" 709 | P9K_DIR_NOT_WRITABLE_BACKGROUND="$DEFAULT_BACKGROUND" 710 | P9K_DIR_NOT_WRITABLE_FOREGROUND="158" 711 | 712 | P9K_ROOT_INDICATOR_BACKGROUND="$DEFAULT_BACKGROUND" 713 | P9K_ROOT_INDICATOR_FOREGROUND="red" 714 | 715 | P9K_STATUS_OK_BACKGROUND="$DEFAULT_BACKGROUND" 716 | P9K_STATUS_OK_FOREGROUND="green" 717 | P9K_STATUS_ERROR_BACKGROUND="$DEFAULT_BACKGROUND" 718 | P9K_STATUS_ERROR_FOREGROUND="red" 719 | 720 | #P9K_TIME_FORMAT="%D{%H:%M:%S \uf017}" #  Jun 15  09:32 721 | P9K_TIME_ICON="\uF017" #  722 | #P9K_TIME_BACKGROUND="$(( $DEFAULT_BACKGROUND - 2 ))" 723 | P9K_TIME_BACKGROUND="$DEFAULT_BACKGROUND" 724 | P9K_TIME_FOREGROUND="183" 725 | 726 | P9K_COMMAND_EXECUTION_TIME_BACKGROUND="$DEFAULT_BACKGROUND" 727 | #P9K_COMMAND_EXECUTION_TIME_FOREGROUND="183" 728 | P9K_COMMAND_EXECUTION_TIME_THRESHOLD=0 729 | P9K_COMMAND_EXECUTION_TIME_PRECISION=1 730 | 731 | P9K_BACKGROUND_JOBS_BACKGROUND="$DEFAULT_BACKGROUND" 732 | P9K_BACKGROUND_JOBS_FOREGROUND="123" 733 | 734 | P9K_USER_DEFAULT_BACKGROUND="$DEFAULT_BACKGROUND" 735 | #P9K_USER_DEFAULT_FOREGROUND="cyan" 736 | P9K_USER_SUDO_BACKGROUND="$DEFAULT_BACKGROUND" 737 | #P9K_USER_SUDO_FOREGROUND="magenta" 738 | P9K_USER_ROOT_BACKGROUND="$DEFAULT_BACKGROUND" 739 | #P9K_USER_ROOT_FOREGROUND="red" 740 | P9K_USER_DEFAULT_ICON="\uF415" #  741 | P9K_USER_ROOT_ICON=$'\uFF03' # # 742 | 743 | P9K_CONTEXT_TEMPLATE="\uF109 %m" 744 | #P9K_CONTEXT_TEMPLATE="\uF109 %m" 745 | P9K_CONTEXT_DEFAULT_BACKGROUND="$DEFAULT_BACKGROUND" 746 | #P9K_CONTEXT_DEFAULT_FOREGROUND="$DEFAULT_FOREGROUND" 747 | P9K_CONTEXT_DEFAULT_FOREGROUND="123" 748 | P9K_CONTEXT_SUDO_BACKGROUND="$DEFAULT_BACKGROUND" 749 | #P9K_CONTEXT_SUDO_FOREGROUND="$DEFAULT_FOREGROUND" 750 | P9K_CONTEXT_SUDO_FOREGROUND="123" 751 | P9K_CONTEXT_REMOTE_BACKGROUND="$DEFAULT_BACKGROUND" 752 | #P9K_CONTEXT_REMOTE_FOREGROUND="$DEFAULT_FOREGROUND" 753 | P9K_CONTEXT_REMOTE_FOREGROUND="123" 754 | P9K_CONTEXT_REMOTE_SUDO_BACKGROUND="$DEFAULT_BACKGROUND" 755 | #P9K_CONTEXT_REMOTE_SUDO_FOREGROUND="$DEFAULT_FOREGROUND" 756 | P9K_CONTEXT_REMOTE_SUDO_FOREGROUND="123" 757 | P9K_CONTEXT_ROOT_BACKGROUND="$DEFAULT_BACKGROUND" 758 | #P9K_CONTEXT_ROOT_FOREGROUND="$DEFAULT_FOREGROUND" 759 | P9K_CONTEXT_ROOT_FOREGROUND="123" 760 | 761 | P9K_HOST_LOCAL_BACKGROUND="$DEFAULT_BACKGROUND" 762 | #P9K_HOST_LOCAL_FOREGROUND="cyan" 763 | P9K_HOST_REMOTE_BACKGROUND="$DEFAULT_BACKGROUND" 764 | #P9K_HOST_REMOTE_FOREGROUND="magenta" 765 | P9K_HOST_LOCAL_ICON="\uF109 " #  766 | P9K_HOST_REMOTE_ICON="\uF489 " #  767 | 768 | P9K_SSH_ICON="\uF489 " #  769 | #P9K_SSH_BACKGROUND="$(( $DEFAULT_BACKGROUND - 2 ))" 770 | P9K_SSH_BACKGROUND="$DEFAULT_BACKGROUND" 771 | P9K_SSH_FOREGROUND="212" 772 | #P9K_OS_ICON_BACKGROUND="$(( $DEFAULT_BACKGROUND - 2 ))" 773 | P9K_OS_ICON_BACKGROUND="$DEFAULT_BACKGROUND" 774 | P9K_OS_ICON_FOREGROUND="212" 775 | #P9K_SHOW_CHANGESET=true 776 | fi 777 | 778 | # Install plugins if there are plugins that have not been installed 779 | if ! zplug check; then 780 | printf "Install plugins? [y/N]: " 781 | if read -q; then 782 | echo; zplug install 783 | fi 784 | fi 785 | 786 | # Then, source plugins and add commands to $PATH 787 | zplug load 788 | 789 | # ============================================================================= 790 | # Completions 791 | # ============================================================================= 792 | #zstyle ':completion:' completer _complete _match _approximate 793 | #zstyle ':completion:' group-name '' 794 | ## Color completion for some items. 795 | ##zstyle ':completion:' list-colors ${(s.:.)LS_COLORS} 796 | #zstyle ':completion:' matcher-list 'm:{a-z}={A-Z}' 797 | #zstyle ':completion:' use-cache true 798 | #zstyle ':completion:' verbose yes 799 | #zstyle ':completion:*:default' menu select=2 800 | #zstyle ':completion:*:descriptions' format '%F{yellow}-- %d --%f' 801 | #zstyle ':completion:*:options' description 'yes' 802 | 803 | zstyle ':completion:*' menu select # select completions with arrow keys 804 | zstyle ':completion:*' group-name '' # group results by category 805 | zstyle ':completion:::::' completer _expand _complete _ignored _approximate # enable approximate matches for completion 806 | 807 | # case-insensitive (uppercase from lowercase) completion 808 | #zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 809 | 810 | # process completion 811 | #zstyle ':completion:*:processes' command 'ps -au$USER' 812 | #zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31" 813 | 814 | # zstyle 815 | zstyle ':completion:*' completer _expand _complete _ignored _approximate 816 | #zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 817 | zstyle ':completion:*' menu select=2 818 | zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' 819 | zstyle ':completion:*:descriptions' format '%U%F{yellow}%d%f%u' 820 | #zstyle ':completion:*:*:git:*' script ~/.git-completion.sh 821 | 822 | zstyle ':completion:*' rehash true 823 | zstyle ':completion:*' verbose yes 824 | zstyle ':completion:*:descriptions' format '%B%d%b' 825 | zstyle ':completion:*:messages' format '%d' 826 | zstyle ':completion:*:warnings' format 'No matches for: %d' 827 | zstyle ':completion:*' group-name '' 828 | 829 | # case-insensitive (all), partial-word and then substring completion 830 | zstyle ":completion:*" matcher-list \ 831 | "m:{a-zA-Z}={A-Za-z}" \ 832 | "r:|[._-]=* r:|=*" \ 833 | "l:|=* r:|=*" 834 | 835 | zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" 836 | zstyle ':completion:*:default' list-colors "${(s.:.)LS_COLORS}" 837 | 838 | #ZLE_RPROMPT_INDENT=0 839 | 840 | [ -f ~/.zshrc.local ] && source ~/.zshrc.local 841 | 842 | # vim: ft=zsh sw=4 sts=4 et 843 | 844 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 845 | -------------------------------------------------------------------------------- /screenshots/Screenshot-20190613174734-654x440.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonylambiris/dotfiles/c7fb2181a214d481316b179aae0237a3e1337864/screenshots/Screenshot-20190613174734-654x440.png -------------------------------------------------------------------------------- /screenshots/Screenshot-20190613174821-654x440.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonylambiris/dotfiles/c7fb2181a214d481316b179aae0237a3e1337864/screenshots/Screenshot-20190613174821-654x440.png -------------------------------------------------------------------------------- /screenshots/Screenshot-20190613175548-654x440.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonylambiris/dotfiles/c7fb2181a214d481316b179aae0237a3e1337864/screenshots/Screenshot-20190613175548-654x440.png --------------------------------------------------------------------------------