1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-24 20:01:49 +08:00
dotfiles/.zshrc

120 lines
4.1 KiB
Bash
Raw Normal View History

2021-11-04 10:59:55 +08:00
cat ~/.config/splash 2> /dev/null || true
2021-09-19 09:06:53 +08:00
echo
2022-05-15 21:54:53 +08:00
echo '\033[0;35m /w '$(awk -F "=" '/^NAME/ {print $2}' 2> /dev/null < /etc/os-release || uname -o)
2021-08-16 22:21:31 +08:00
echo '\033[0;34m @ '$HOST
#Install zinit if no zinit is present
2022-04-16 19:18:52 +08:00
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
if [[ ! -f $ZINIT_HOME/zinit.zsh ]]; then
2021-08-16 22:21:31 +08:00
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
2022-05-03 20:44:48 +08:00
mkdir -p "$(dirname $ZINIT_HOME)"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
2021-08-16 22:21:31 +08:00
fi
2022-04-16 19:18:52 +08:00
source "$ZINIT_HOME/zinit.zsh"
2021-08-16 22:21:31 +08:00
zinit ice lucid wait
zinit light zdharma-continuum/fast-syntax-highlighting
zinit ice lucid wait
zinit light agkozak/zsh-z
zinit ice lucid wait
zinit light juancldcmt/colorize
zinit ice lucid wait
zinit light juancldcmt/shortify.zsh
2022-05-12 22:54:17 +08:00
zinit ice lucid wait
zinit light juancldcmt/direnv.zsh
2021-08-16 22:21:31 +08:00
zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh'
zinit light sindresorhus/pure
zinit light zsh-users/zsh-autosuggestions
zinit light hlissner/zsh-autopair
zinit light zsh-users/zsh-history-substring-search
2021-08-16 22:21:31 +08:00
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
2022-06-12 22:43:55 +08:00
eval `dircolors`
# The following lines were added by compinstall
zstyle ':completion:*' auto-description 'Specify: %F{magenta}%d%f'
zstyle ':completion:*' completer _oldlist _expand _complete _ignored _match _correct _approximate _prefix
zstyle ':completion:*' completions 1
2021-08-16 22:21:31 +08:00
zstyle ':completion:*' expand prefix suffix
2022-06-12 22:43:55 +08:00
zstyle ':completion:*' file-sort access
2021-08-16 22:21:31 +08:00
zstyle ':completion:*' format 'Completing %F{magenta}%d%f'
2022-06-12 22:43:55 +08:00
zstyle ':completion:*' glob 1
2021-08-16 22:21:31 +08:00
zstyle ':completion:*' group-name ''
2022-06-12 22:43:55 +08:00
zstyle ':completion:*' ignore-parents parent pwd ..
2021-08-16 22:21:31 +08:00
zstyle ':completion:*' insert-unambiguous true
2022-06-12 22:43:55 +08:00
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**'
zstyle ':completion:*' max-errors 8 numeric
2021-08-16 22:21:31 +08:00
zstyle ':completion:*' menu select=1
2022-06-12 22:43:55 +08:00
zstyle ':completion:*' original false
2021-08-16 22:21:31 +08:00
zstyle ':completion:*' preserve-prefix '//[^/]##/'
2022-06-12 22:43:55 +08:00
zstyle ':completion:*' prompt 'Completing, with %e errors'
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' substitute 1
zstyle ':completion:*' use-compctl true
2021-08-16 22:21:31 +08:00
zstyle :compinstall filename '/home/juan/.zshrc'
2022-06-12 22:43:55 +08:00
2021-08-16 22:21:31 +08:00
autoload -Uz compinit
compinit
2022-06-12 22:43:55 +08:00
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.cache/zhistory
2021-08-16 22:21:31 +08:00
HISTSIZE=8192
SAVEHIST=8192
setopt autocd extendedglob nomatch notify auto_pushd
unsetopt beep
bindkey -v
2022-06-12 22:43:55 +08:00
# End of lines configured by zsh-newuser-install
2021-08-16 22:21:31 +08:00
export KEYTIMEOUT=1
#edit in vim
autoload edit-command-line
zle -N edit-command-line
bindkey '' edit-command-line
2022-06-12 22:43:55 +08:00
zmodload zsh/complist
2022-05-12 23:03:14 +08:00
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
2021-08-16 22:21:31 +08:00
2022-05-12 23:03:14 +08:00
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
2022-06-12 22:43:55 +08:00
bindkey '' history-substring-search-up
bindkey '' history-substring-search-down
2021-08-16 22:21:31 +08:00
2022-05-12 23:03:14 +08:00
bindkey ' ' magic-space
2022-06-12 22:43:55 +08:00
bindkey '' autosuggest-execute
2021-08-16 22:21:31 +08:00
#config location
export GOPATH=$HOME/.cache/go
export LESSHISTFILE=/dev/null
export LYNX_CFG=$HOME/.config/lynx/lynxrc
export XDG_CACHE_HOME=$HOME/.cache
export XDG_CONFIG_HOME=$HOME/.config
2021-08-16 22:21:31 +08:00
2021-08-25 19:56:23 +08:00
#settings for software
export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt=🔎"
2021-09-26 11:28:00 +08:00
export GPG_TTY=$(tty) # fixes gpg
2021-08-25 19:56:23 +08:00
2021-08-16 22:21:31 +08:00
#colored output
export MANWIDTH=${MANWIDTH:-78}
export MANLESS="Manual\ \$MAN_PN\ ?ltline\ %lt?L/%L.:byte\ %bB?s/%s..?\:?pB\ %pB\\%.."
export LESS="-RSM~"
#local path
export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin"
2021-08-19 18:10:24 +08:00
export MANPATH="${MANPATH}:${HOME}/.local/share/man"
2021-08-16 22:21:31 +08:00
#ccache support
export USE_CCACHE=1
export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH"