diff options
Diffstat (limited to 'zsh')
m--------- | zsh/.config/zsh/zsh-autosuggestions | 0 | ||||
m--------- | zsh/.config/zsh/zsh-completions | 0 | ||||
m--------- | zsh/.config/zsh/zsh-syntax-highlighting | 0 | ||||
-rw-r--r-- | zsh/.zshcomplete | 26 | ||||
-rw-r--r-- | zsh/.zshinput | 37 | ||||
-rw-r--r-- | zsh/.zshrc | 77 |
6 files changed, 140 insertions, 0 deletions
diff --git a/zsh/.config/zsh/zsh-autosuggestions b/zsh/.config/zsh/zsh-autosuggestions new file mode 160000 +Subproject c3d4e576c9c86eac62884bd47c01f6faed043fc diff --git a/zsh/.config/zsh/zsh-completions b/zsh/.config/zsh/zsh-completions new file mode 160000 +Subproject 83cbd8108261e3285b0744f4d412f68525dd18e diff --git a/zsh/.config/zsh/zsh-syntax-highlighting b/zsh/.config/zsh/zsh-syntax-highlighting new file mode 160000 +Subproject e0165eaa730dd0fa321a6a6de74f092fe87630b diff --git a/zsh/.zshcomplete b/zsh/.zshcomplete new file mode 100644 index 0000000..fa206b4 --- /dev/null +++ b/zsh/.zshcomplete @@ -0,0 +1,26 @@ +# The following lines were added by compinstall + +zstyle ':completion:*' completer _complete _ignored _prefix +zstyle ':completion:*' expand prefix suffix +zstyle ':completion:*' insert-unambiguous true +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' list-prompt %S\(%p\)%s +zstyle ':completion:*' list-suffixes true +zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'l:|=* r:|=*' +zstyle ':completion:*' original false +zstyle ':completion:*:processes-names' command 'ps axho command' +zstyle ':completion:*:*:kill:*:processes' command 'ps --forest -A -o pid,user,cmd' +zstyle :compinstall filename "${HOME}/.zshcomplete" + +autoload -Uz compinit +compinit +autoload -Uz bashcompinit +bashcompinit +# End of lines added by compinstall + +source ~/.config/sh/fzf/shell/completion.zsh +type kubectl >/dev/null 2>&1 && source <(kubectl completion zsh) +if type steampipe >/dev/null 2>&1; then + source <(steampipe completion zsh) + compdef _steampipe steampipe +fi diff --git a/zsh/.zshinput b/zsh/.zshinput new file mode 100644 index 0000000..ada9a5e --- /dev/null +++ b/zsh/.zshinput @@ -0,0 +1,37 @@ +bindkey -v + +source ~/.config/sh/fzf/shell/key-bindings.zsh + +autoload history-search-end +zle -N history-beginning-search-backward-end history-search-end +zle -N history-beginning-search-forward-end history-search-end +bindkey "^[[A" history-beginning-search-backward-end +bindkey "^[[B" history-beginning-search-forward-end +bindkey "^[OA" history-beginning-search-backward-end +bindkey "^[OB" history-beginning-search-forward-end + +bindkey -M viins '^R' fzf-history-widget +bindkey -M vicmd '^R' fzf-history-widget + +bindkey -M vicmd ')' vi-digit-or-beginning-of-line +bindkey -M vicmd 'e' vi-change +bindkey -M vicmd 'E' vi-change-eol +bindkey -M vicmd '_' vi-first-non-blank +bindkey -M vicmd '|' send-break + +bindkey "^?" backward-delete-char +bindkey "^H" backward-delete-char +bindkey -M viins "^[[3~" delete-char +bindkey -M vicmd "^[[3~" delete-char + +page-up-within-tmux() { + if [[ $TMUX == '' ]]; then + : + else + tmux copy-mode -u + fi +} +zle -N page-up-within-tmux + +# page up +bindkey "${terminfo[kpp]}" page-up-within-tmux diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..5bd948b --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,77 @@ +for file in ~/.config/sh/rc.d/*; do + # shellcheck disable=SC1090 + source "$file" +done +# completion {{{ +# shellcheck disable=SC2206 +fpath=( \ + "${HOME}/.config/zsh/local-completions/$(hostname)" \ + "${HOME}/.config/zsh/local-completions" \ + "${HOME}/.config/zsh/zsh-completions/src" \ + $fpath \ +) +# shellcheck source=zsh/.zshcomplete +source ~/.zshcomplete +# }}} +# zsh configuration {{{ +# shellcheck source=zsh/.zshinput +source ~/.zshinput +autoload -U colors +colors +setopt incappendhistory +setopt extendedhistory +setopt histignoredups +setopt noclobber +setopt nobeep +setopt completeinword +setopt correct +export HISTFILE=$HOME/.zsh_history +export HISTSIZE=1000000000 +export SAVEHIST=1000000000 +# shellcheck disable=SC2154 +export SPROMPT="Correct ${fg[red]}%R$reset_color to ${fg[green]}%r$reset_color? [ynae] " +export KEYTIMEOUT=5 +# plugins {{{ +# zsh-syntax-highlighting {{{ +# shellcheck disable=SC2154,SC2034 +{ +ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) +# shellcheck source=zsh/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +# shellcheck disable=SC1094 +source ~/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=green' +ZSH_HIGHLIGHT_STYLES[alias]='fg=green' +ZSH_HIGHLIGHT_STYLES[builtin]='fg=green' +ZSH_HIGHLIGHT_STYLES[function]='fg=green' +ZSH_HIGHLIGHT_STYLES[command]='fg=green' +ZSH_HIGHLIGHT_STYLES[precommand]='fg=yellow' +ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green' +ZSH_HIGHLIGHT_STYLES[path]='fg=blue,bold' +ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=blue,underline' +ZSH_HIGHLIGHT_STYLES[path_approx]='underline' +ZSH_HIGHLIGHT_STYLES[globbing]='fg=magenta' +ZSH_HIGHLIGHT_STYLES[history-expansion]='none' +ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=green' +ZSH_HIGHLIGHT_STYLES[assign]='fg=cyan' +} +# }}} +# zsh-autosuggestions {{{ +# shellcheck source=zsh/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh +# shellcheck disable=SC1094 +source ~/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh +# shellcheck disable=SC2034 +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=black,bold' +# see https://github.com/zsh-users/zsh-autosuggestions/issues/619 +unset ZSH_AUTOSUGGEST_USE_ASYNC +# }}} +# }}} +# prompt {{{ +if type starship > /dev/null 2>&1; then + eval "$(starship init zsh)" +fi +# }}} +# }}} +# fortune {{{ +fortune -n600 -s ~/.local/share/fortune | grep -v -E "^$" +# }}} +# vim: fdm=marker |