summaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'zsh')
-rw-r--r--zsh/.zlogout1
-rw-r--r--zsh/.zprofile6
-rw-r--r--zsh/.zshenv10
-rw-r--r--zsh/.zshrc158
4 files changed, 98 insertions, 77 deletions
diff --git a/zsh/.zlogout b/zsh/.zlogout
deleted file mode 100644
index 33666be..0000000
--- a/zsh/.zlogout
+++ /dev/null
@@ -1 +0,0 @@
-rm -rf /tmp/xorg-awake
diff --git a/zsh/.zprofile b/zsh/.zprofile
deleted file mode 100644
index 1eae5e7..0000000
--- a/zsh/.zprofile
+++ /dev/null
@@ -1,6 +0,0 @@
-#export GDK_DPI_SCALE=0.7
-
-#gnome_schema=org.gnome.desktop.interface
-#
-#gsettings set $gnome_schema gtk-theme 'Plata-Noir-Compact'
-#gsettings set $gnome_schema icon-theme 'Papirus-Dark'
diff --git a/zsh/.zshenv b/zsh/.zshenv
index 5278ada..3719ef4 100644
--- a/zsh/.zshenv
+++ b/zsh/.zshenv
@@ -1,5 +1,7 @@
+# ZSH SPECIFIC CONFIGS
unset HISTFILE
-
-unset HISTFILE
-export ZDOTDIR=$HOME/.config/zsh
-#export HISTFILE="$XDG_DATA_HOME"/zsh/history
+export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
+export skip_global_compinit=1
+fpath=($XDG_CONFIG_HOME/functions $fpath)
+[ -f /etc/profile ] && . /etc/profile
+[ -f "$XDG_CONFIG_HOME/sh/profile" ] && . "$XDG_CONFIG_HOME/sh/profile"
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 70b5fef..d284d1d 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -1,4 +1,6 @@
-HISTFILE="$ZDOTDIR"/hist
+#zmodload zsh/zprof
+[ -z "$XDG_CONFIG_HOME" ] && XDG_CONFIG_HOME="$HOME/.config"
+HISTFILE="$XDG_CONFIG_HOME/zsh/hist"
SAVEHIST=1000
HISTSIZE=1000
setopt APPEND_HISTORY
@@ -8,6 +10,8 @@ setopt HIST_VERIFY
setopt HIST_IGNORE_DUPS
setopt INC_APPEND_HISTORY
setopt HIST_REDUCE_BLANKS
+setopt COMPLETE_ALIASES
+setopt AUTO_CD
_SH="zsh"
@@ -15,88 +19,110 @@ fpath=("$XDG_CONFIG_HOME"/zsh/functions(:A) $fpath)
autoload -Uz anonsh
if [ -f "$XDG_CONFIG_HOME"/sh/aliases ]; then
- source "$XDG_CONFIG_HOME"/sh/aliases
+ source "$XDG_CONFIG_HOME"/sh/aliases
fi
if [ -f "$XDG_CONFIG_HOME"/sh/functions ]; then
- source "$XDG_CONFIG_HOME"/sh/functions
+ source "$XDG_CONFIG_HOME"/sh/functions
fi
-if [ -n "$ZDOTDIR"/.zshrc -a -f "$ZDOTDIR"/.zshrc ]; then
- alias e='source "$ZDOTDIR"/.zshrc'
+if [ -f "$XDG_CONFIG_HOME/zsh/zshrc" ]; then
+ alias e='source "$XDG_CONFIG_HOME/zsh/zshrc"'
+elif [ -f "$XDG_CONFIG_HOME/zshrc" ]; then
+ alias e='source "$XDG_CONFIG_HOME/zshrc"'
elif [ -f "$HOME"/.zshrc ]; then
alias e='source ~/.zshrc'
fi
-bindkey "^?" backward-delete-char
+source ~/.config/zsh/.zkbd/$TERM-${${DISPLAY:t}:-$VENDOR-$OSTYPE}
+
+#autoload zkbd; zkbd
+bindkey -v
+bindkey "${key[Backspace]}" backward-delete-char
+bindkey "${key[Delete]}" delete-char
+bindkey "${key[Home]}" beginning-of-line
+bindkey "${key[End]}" end-of-line
+bindkey "${key[PageUp]}" history-substring-search-up
+bindkey "${key[PageDown]}" history-substring-search-down
+
+if (env | grep -Fq 'DISTROBOX'); then
+ MYPROMPT=$'%F{000}%K{004}[%n@%m]%F{013}\UE0B2%K{013}%F{000}%~%F{013}%K{004}\UE0B0%F{000}%#%F{004}%k\UE0B0%f '
+else
+ MYPROMPT=$'%F{000}%K{002}[%n@%m]%F{006}\UE0B2%K{006}%F{000}%~%F{006}%K{002}\UE0B0%F{000}%#%F{002}%k\UE0B0%f '
+fi
+function zle-line-init zle-keymap-select {
+ VIM_PROMPT=$'%F{000}%K{012}[%n@%m]%F{006}\UE0B2%K{006}%F{000}%~%F{006}%K{012}\UE0B0%F{000}%#%F{012}%k\UE0B0%f '
+ PS1="${${KEYMAP/vicmd/$VIM_PROMPT}/main/$MYPROMPT}"
+ zle reset-prompt
+}
-# bindkey -v
+zle -N zle-line-init
+zle -N zle-keymap-select
+export KEYTIMEOUT=1
-if [ "$TERM" = "st-256color" ] || [ "$TERM" = "xterm-256color" ]; then
- function zle-line-init () { echoti smkx }
- function zle-line-finish () { echoti rmkx }
+fpath+="$XDG_CONFIG_HOME/zsh/functions"
- zle -N zle-line-init
- zle -N zle-line-finish
-fi
+autoload -Uz anonsh
-unset COLOR1
-ZSHTHEMERC="${ZDOTDIR:-$HOME}/.zsh_theme"
-[ -f "$ZSHTHEMERC" ] && . "$ZSHTHEMERC"
-
-if [ -z "$COLOR1" ]; then
- case "$(whoami)" in
- zachir) COLOR1="014" ;;
- git) COLOR1="013" ;;
- subsonic) COLOR1="012" ;;
- *) COLOR1="015" ;;
- esac
+autoload -Uz compinit
+if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
+ compinit
+else
+ compinit -C
fi
-MYPROMPT='%B%S%F{'"$COLOR1"'}[%n@%m]:%f%s%F{015}%~%f%S%F{'"$COLOR1"'}%#%f%s%b '
-function zle-line-init zle-keymap-select {
- VIM_PROMPT="%B%F{012}[%n@%m]:%f%F{015}%~%f%F{012}%#%f%b "
- PS1="${${KEYMAP/vicmd/$VIM_PROMPT}/main/$MYPROMPT}"
- #PS1="$PROMPT $KEYMAP"
- zle reset-prompt
-}
+zshcache_time="$(date +%s%N)"
-unset COLOR1
+autoload -Uz add-zsh-hook
-zle -N zle-line-init
-zle -N zle-keymap-select
-export KEYTIMEOUT=1
+rehash_precmd() {
+ if [[ -a /var/cache/zsh/pacman ]]; then
+ local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)"
+ if (( zshcache_time < paccache_time )); then
+ rehash
+ zshcache_time="$paccache_time"
+ fi
+ fi
+}
-autoload -Uz compinit promptinit
-compinit -d $CONFIG/zcompdump
-promptinit
-autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
-zle -N up-line-or-beginning-search
-zle -N down-line-or-beginning-search
+add-zsh-hook -Uz precmd rehash_precmd
-zstyle ':completion:*' menu select
-zstyle ':completion::complete:*' gain-privileges 1
-zstyle ':completion:*' rehash true
+zstyle ':completion:*' hosts off
-setopt COMPLETE_ALIASES
-setopt AUTO_CD
+### Added by Zinit's installer
+if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
+ print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
+ command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
+ command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
+ print -P "%F{33} %F{34}Installation successful.%f%b" || \
+ print -P "%F{160} The clone has failed.%f%b"
+fi
-typeset -g -A key
-
-key[Up]="${terminfo[kcuu1]}"
-key[Down]="${terminfo[kcud1]}"
-key[Left]="${terminfo[kcub1]}"
-key[Right]="${terminfo[kcuf1]}"
-key[Shift-Tab]="${terminfo[kcbt]}"
-key[Delete]="${terminfo[kdch1]}"
-
-[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-beginning-search
-bindkey -- '^[[A' up-line-or-beginning-search
-bindkey -- '^[[B' down-line-or-beginning-search
-[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-beginning-search
-[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char
-[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char
-[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
-[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char
-
-#eval "$(starship init zsh)"
-type portmaster-start 2>&1 >/dev/null && eval "$(portmaster-start --data=/opt/safing/portmaster completion zsh)"
+source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
+autoload -Uz _zinit
+(( ${+_comps} )) && _comps[zinit]=_zinit
+
+# Load a few important annexes, without Turbo
+# (this is currently required for annexes)
+zinit light-mode for \
+ zdharma-continuum/zinit-annex-as-monitor \
+ zdharma-continuum/zinit-annex-bin-gem-node \
+ zdharma-continuum/zinit-annex-patch-dl \
+ zdharma-continuum/zinit-annex-rust
+
+### End of Zinit's installer chunk
+zinit snippet OMZ::plugins/git/git.plugin.zsh
+
+zinit load 'zsh-users/zsh-history-substring-search'
+zinit ice wait atload'_history_substring_search_config'
+
+bindkey "${key[Up]}" history-substring-search-up
+bindkey "${key[Down]}" history-substring-search-down
+bindkey -M vicmd "${key[Up]}" history-substring-search-up
+bindkey -M vicmd "${key[Down]}" history-substring-search-down
+bindkey -M vicmd "k" history-substring-search-up
+bindkey -M vicmd "j" history-substring-search-down
+
+#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+zinit light 'zsh-users/zsh-syntax-highlighting'
+zinit ice wait atload'_history_substring_search_config'
+#zprof