mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
zsh: switch to zinit & zsh-fsh
These are significantly faster to load, and are actively maintained. Functionality is almost identical from a usability perspective. The primary motivation for this change is the several orders of magnitude faster shell loading times, which should help with productivity on overloaded and underpowered hardware. Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
parent
5ace0bb7f4
commit
6d33d4685c
@ -1,7 +1,6 @@
|
||||
# Override paths for non-compliant programs
|
||||
# https://wiki.archlinux.org/index.php/XDG_Base_Directory_support
|
||||
|
||||
ADOTDIR="$XDG_DATA_HOME/zsh/antigen"
|
||||
ASPELL_CONF="per-conf $XDG_CONFIG_HOME/aspell/aspell.conf; personal $XDG_CONFIG_HOME/aspell/en.pws; repl $XDG_CONFIG_HOME/aspell/en.prepl"
|
||||
CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||
GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
|
||||
|
82
fsh/fish.ini
Normal file
82
fsh/fish.ini
Normal file
@ -0,0 +1,82 @@
|
||||
[base]
|
||||
default = 12
|
||||
unknown-token = red,bold
|
||||
commandseparator = cyan
|
||||
redirection = cyan,bold
|
||||
here-string-tri = yellow
|
||||
here-string-text = 18
|
||||
here-string-var = cyan,bg:18
|
||||
exec-descriptor = yellow,bold
|
||||
comment = 7
|
||||
correct-subtle = 12
|
||||
incorrect-subtle = red
|
||||
subtle-separator = green
|
||||
subtle-bg = bg:18
|
||||
secondary =
|
||||
recursive-base =
|
||||
|
||||
[command-point]
|
||||
reserved-word = yellow
|
||||
subcommand = yellow
|
||||
alias = blue
|
||||
suffix-alias = green
|
||||
global-alias = blue,bold
|
||||
builtin = blue
|
||||
function = blue
|
||||
command = blue
|
||||
precommand = blue
|
||||
hashed-command = green
|
||||
single-sq-bracket = green
|
||||
double-sq-bracket = green
|
||||
double-paren = yellow
|
||||
|
||||
[paths]
|
||||
path = cyan
|
||||
pathseparator = cyan
|
||||
path-to-dir = magenta,underline
|
||||
globbing = red
|
||||
globbing-ext = 13
|
||||
|
||||
[brackets]
|
||||
paired-bracket = bg:blue
|
||||
bracket-level-1 = green,bold
|
||||
bracket-level-2 = yellow,bold
|
||||
bracket-level-3 = cyan,bold
|
||||
|
||||
[arguments]
|
||||
single-hyphen-option = 12
|
||||
double-hyphen-option = 12
|
||||
back-quoted-argument = none
|
||||
single-quoted-argument = yellow
|
||||
double-quoted-argument = yellow
|
||||
dollar-quoted-argument = yellow
|
||||
|
||||
[in-string]
|
||||
; backslash in $'...'
|
||||
back-dollar-quoted-argument = cyan
|
||||
; backslash or $... in "..."
|
||||
back-or-dollar-double-quoted-argument = cyan
|
||||
|
||||
[other]
|
||||
variable = 113
|
||||
assign = green
|
||||
assign-array-bracket = green
|
||||
history-expansion = blue,bold
|
||||
|
||||
[math]
|
||||
mathvar = blue,bold
|
||||
mathnum = magenta
|
||||
matherr = red
|
||||
|
||||
[for-loop]
|
||||
forvar = none
|
||||
fornum = magenta
|
||||
; operator
|
||||
foroper = yellow
|
||||
; separator
|
||||
forsep = yellow,bold
|
||||
|
||||
[case]
|
||||
case-input = green
|
||||
case-parentheses = yellow
|
||||
case-condition = bg:blue
|
82
zsh/.zshrc
82
zsh/.zshrc
@ -60,21 +60,25 @@ export WORDCHARS='*?_[]~=&;!#$%^(){}'
|
||||
x-bash-backward-kill-word(){ WORDCHARS='' zle kill-word; }
|
||||
zle -N x-bash-backward-kill-word
|
||||
|
||||
# Load antigen & plugins
|
||||
ANTIGEN_LOG="$LOG_DIR/antigen-$(date -u --iso-8601=seconds | cut -d+ -f1).log"
|
||||
antigen_src="$ADOTDIR/antigen.zsh"
|
||||
if [ ! -f "$antigen_src" ]; then
|
||||
git clone https://github.com/zsh-users/antigen.git "$ADOTDIR"
|
||||
declare -A ZINIT
|
||||
ZINIT[HOME_DIR]="$XDG_CACHE_HOME/zsh/zinit"
|
||||
ZINIT[BIN_DIR]="${ZINIT[HOME_DIR]}/bin"
|
||||
ZINIT[PLUGINS_DIR]="${ZINIT[HOME_DIR]}/plugins"
|
||||
if [ ! -e "${ZINIT[HOME_DIR]}" ]; then
|
||||
git clone https://github.com/zdharma/zinit.git "${ZINIT[HOME_DIR]}"
|
||||
fi
|
||||
source "$antigen_src"
|
||||
source "${ZINIT[HOME_DIR]}"/zinit.zsh
|
||||
|
||||
antigen bundle zsh-users/zsh-completions
|
||||
antigen bundle zsh-users/zsh-autosuggestions
|
||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||
antigen bundle mafredri/zsh-async
|
||||
antigen bundle agkozak/zsh-z
|
||||
zinit wait lucid light-mode for \
|
||||
atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
|
||||
zdharma/fast-syntax-highlighting \
|
||||
blockf \
|
||||
zsh-users/zsh-completions \
|
||||
atload"!_zsh_autosuggest_start" \
|
||||
zsh-users/zsh-autosuggestions
|
||||
|
||||
antigen apply
|
||||
zinit light Aloxaf/fzf-tab
|
||||
zinit light agkozak/zsh-z
|
||||
|
||||
# Vim mode!
|
||||
bindkey -v
|
||||
@ -114,41 +118,6 @@ ZSH_AUTOSUGGEST_USE_ASYNC=true
|
||||
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=128
|
||||
ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}")
|
||||
|
||||
default='fg=12'
|
||||
prog='fg=blue'
|
||||
ZSH_HIGHLIGHT_STYLES=()
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets root line)
|
||||
ZSH_HIGHLIGHT_STYLES[root]='bg=red'
|
||||
ZSH_HIGHLIGHT_STYLES[default]=$default
|
||||
ZSH_HIGHLIGHT_STYLES[arg0]=$prog
|
||||
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow'
|
||||
ZSH_HIGHLIGHT_STYLES[alias]=$prog
|
||||
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green'
|
||||
ZSH_HIGHLIGHT_STYLES[builtin]='fg=4'
|
||||
ZSH_HIGHLIGHT_STYLES[function]=$prog
|
||||
ZSH_HIGHLIGHT_STYLES[command]=$prog
|
||||
ZSH_HIGHLIGHT_STYLES[precommand]='fg=4'
|
||||
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green'
|
||||
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[path_separator]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=208'
|
||||
ZSH_HIGHLIGHT_STYLES[globbing]='fg=red'
|
||||
ZSH_HIGHLIGHT_STYLES[comment]='fg=7'
|
||||
ZSH_HIGHLIGHT_STYLES[history-expansion]=$default
|
||||
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=$default
|
||||
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=$default
|
||||
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=magenta'
|
||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=yellow'
|
||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=yellow'
|
||||
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=yellow'
|
||||
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[assign]='fg=green'
|
||||
ZSH_HIGHLIGHT_STYLES[redirection]='fg=cyan,bold'
|
||||
|
||||
source "$XDG_CONFIG_HOME/aliases"
|
||||
|
||||
# Load some manual plugins
|
||||
@ -156,18 +125,7 @@ source "$ZSH_DIR/plugins/sudo.zsh"
|
||||
source "$ZSH_DIR/plugins/fish-theme.zsh"
|
||||
source "$ZSH_DIR/plugins/git-rprompt.zsh"
|
||||
|
||||
trysource() { [ -f "$1" ] && source "$1"; }
|
||||
trysource /usr/share/fzf/key-bindings.zsh 2>&1 # Arch/sensible distros
|
||||
trysource /usr/share/doc/fzf/examples/key-bindings.zsh 2>&1 # Debian, because Debian
|
||||
trysource /usr/share/doc/pkgfile/command-not-found.zsh 2>&1 # pkgfile on Arch
|
||||
trysource /usr/share/z/z.sh
|
||||
|
||||
# Completion initialisation
|
||||
autoload -U compinit bashcompinit
|
||||
compinit
|
||||
bashcompinit
|
||||
|
||||
# gopass completion
|
||||
if exists gopass; then
|
||||
source <(gopass completion bash)
|
||||
fi
|
||||
trysource() { for f in "$@"; do source "$f" 2>/dev/null && return; done; }
|
||||
trysource /usr/share/fzf/key-bindings.zsh \
|
||||
/usr/share/doc/fzf/examples/key-bindings.zsh
|
||||
trysource /usr/share/doc/pkgfile/command-not-found.zsh # pkgfile on Arch
|
||||
|
Loading…
Reference in New Issue
Block a user