summaryrefslogtreecommitdiffstats
path: root/zsh/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'zsh/.zshrc')
-rw-r--r--zsh/.zshrc51
1 files changed, 26 insertions, 25 deletions
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 43aac8d..d6a4292 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -1,35 +1,31 @@
# 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"
+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
+PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:$PATH"
+export PATH
+# shellcheck source=sh/.config/sh/env
+[ -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
+# shellcheck source=sh/.config/sh/aliases
+[ -f "$HOME/.config/sh/aliases" ] && source "$HOME/.config/sh/aliases"
# }}}
# completion {{{
-fpath=(~/.config/zsh/local-completions/$(hostname) ~/.config/zsh/local-completions ~/.config/zsh/zsh-completions/src $fpath)
+# 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
@@ -40,18 +36,19 @@ 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] "
+# shellcheck disable=SC2154
+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 {{{
+# 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'
@@ -67,9 +64,13 @@ 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