diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-10-08 12:09:20 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-10-08 12:59:10 -0400 |
commit | 49570c8dd03448240897b37b68567352b790f16f (patch) | |
tree | 6c192a52046d5d0dd1b84a838befd8e777cfeafb /zsh | |
parent | 66939c71da756c1d9e07a88a4a8ea2a018650060 (diff) | |
download | conf-49570c8dd03448240897b37b68567352b790f16f.tar.gz conf-49570c8dd03448240897b37b68567352b790f16f.zip |
convert to stow
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.config/zsh/local-completions/hornet/_sv | 10 | ||||
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 | 21 | ||||
-rw-r--r-- | zsh/.zshinput | 47 | ||||
-rw-r--r-- | zsh/.zshrc | 90 |
7 files changed, 168 insertions, 0 deletions
diff --git a/zsh/.config/zsh/local-completions/hornet/_sv b/zsh/.config/zsh/local-completions/hornet/_sv new file mode 100644 index 0000000..218e95f --- /dev/null +++ b/zsh/.config/zsh/local-completions/hornet/_sv @@ -0,0 +1,10 @@ +#compdef svdn svget svkill svlog svdisable svre svst svstop svup + +local -a service_list +local services=$(ls ~/.services/enabled/) +service_list=(${(f)services}) + +_describe 'commands' service_list + +# shfmt:skip (shfmt doesn't recognize zsh array expansion) +# vim:ft=zsh diff --git a/zsh/.config/zsh/zsh-autosuggestions b/zsh/.config/zsh/zsh-autosuggestions new file mode 160000 +Subproject a411ef3e0992d4839f0732ebeb9823024afaaaa diff --git a/zsh/.config/zsh/zsh-completions b/zsh/.config/zsh/zsh-completions new file mode 160000 +Subproject 86d55972f5cb65d545389fe0306e617b6832898 diff --git a/zsh/.config/zsh/zsh-syntax-highlighting b/zsh/.config/zsh/zsh-syntax-highlighting new file mode 160000 +Subproject 754cefe0181a7acd42fdcb357a67d0217291ac4 diff --git a/zsh/.zshcomplete b/zsh/.zshcomplete new file mode 100644 index 0000000..0198f58 --- /dev/null +++ b/zsh/.zshcomplete @@ -0,0 +1,21 @@ +# 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 diff --git a/zsh/.zshinput b/zsh/.zshinput new file mode 100644 index 0000000..3ab9ac4 --- /dev/null +++ b/zsh/.zshinput @@ -0,0 +1,47 @@ +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 '/' history-incremental-search-backward +bindkey -M vicmd '?' history-incremental-search-forward +bindkey -rM viins '^[/' + +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 ',' execute-named-cmd +bindkey -M vicmd '!' vi-insert +bindkey -M vicmd '_' vi-first-non-blank +bindkey -M vicmd '|' send-break +bindkey -M vicmd '\' send-break + +bindkey "^?" backward-delete-char +bindkey "^H" backward-delete-char +bindkey "^U" backward-kill-line + +bindkey "^[[3~" delete-char + +page-up-within-tmux() { + if [[ $TMUX == '' ]]; then + # no-op; default behavior isn't useful, and anyway you don't want to do + # something TOO cool here since you won't be able to do it inside tmux. + # TODO if there's any way to command the /emu/ to scroll up one page, i + # would love to hear about it + 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..2fa8d52 --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,90 @@ +# language environments {{{ +test -f $HOME/perl5/perlbrew/etc/bashrc && source $HOME/perl5/perlbrew/etc/bashrc +test -f $HOME/python/bin/activate && source $HOME/python/bin/activate +type rbenv > /dev/null 2>&1 && eval "$(rbenv init -)" +test -d $HOME/.cargo/bin && export PATH="$HOME/.cargo/bin:$PATH" +# }}} +# environment {{{ +# not using .zshenv, because it runs before /etc/profile, and /etc/profile +# tends to hard-set $PATH and such +[ -d /usr/share/git/diff-highlight ] && export PATH="/usr/share/git/diff-highlight:${PATH}" +[ -d /usr/local/share/git-core/contrib/diff-highlight ] && export PATH="/usr/local/share/git-core/contrib/diff-highlight:${PATH}" +export PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:/usr/lib/ccache/bin:$PATH" +[ -f "$HOME/.config/sh/env" ] && source $HOME/.config/sh/env +# }}} +# Change the window title of X terminals {{{ +function term_title_precmd () { + echo -ne "\033]0;${USER}@${HOST}:${PWD/$HOME/~}\007" +} +case ${TERM} in + xterm*|rxvt*|Eterm|aterm|kterm|gnome|screen*) + precmd_functions+=(term_title_precmd) + ;; +esac # }}} +# aliases {{{ +[ -f "$HOME/.config/sh/aliases" ] && source $HOME/.config/sh/aliases +[ -f "$HOME/.config/sh/functions" ] && source $HOME/.config/sh/functions +# }}} +# completion {{{ +fpath=(~/.config/zsh/local-completions/$(hostname) ~/.config/zsh/local-completions ~/.config/zsh/zsh-completions/src $fpath) +source ~/.zshcomplete +# }}} +# zsh configuration {{{ +source ~/.zshinput +autoload -U colors +colors +setopt incappendhistory +setopt extendedhistory +setopt histignoredups +setopt noclobber +setopt nobeep +setopt completeinword +setopt correct +export REPORTTIME=120 +export HISTFILE=$HOME/.zsh_history +export HISTSIZE=1000000000 +export SAVEHIST=1000000000 +export SPROMPT="Correct $fg[red]%R$reset_color to $fg[green]%r$reset_color? [ynae] " +export KEYTIMEOUT=5 +# plugins {{{ +# cdhist {{{ +source ~/.config/sh/cdhist.sh +# }}} +# zsh-syntax-highlighting {{{ +ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) +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 {{{ +source ~/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=black,bold' +# see https://github.com/zsh-users/zsh-autosuggestions/issues/619 +unset ZSH_AUTOSUGGEST_USE_ASYNC +# }}} +# vim-history-sync {{{ +source ~/.vim/pack/plugins/start/history-sync/sh/history-sync.zsh +# }}} +# }}} +# 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 |