Cleaning up.
This commit is contained in:
parent
0762c38b50
commit
f26274aeae
19 changed files with 2 additions and 2 deletions
8
config/zsh/.zshenv
Normal file
8
config/zsh/.zshenv
Normal file
|
@ -0,0 +1,8 @@
|
|||
skip_global_compinit=1
|
||||
export XDG_CACHE_HOME=/tmp/${USER}-cache
|
||||
export XDG_CONFIG_HOME=$HOME/.config
|
||||
export XDG_DATA_HOME=$HOME/.local/share
|
||||
export XDG_STATE_HOME=$HOME/.local/state
|
||||
export HISTFILE=$XDG_DATA_HOME/zsh/history
|
||||
export HISTSIZE=10000
|
||||
export SAVEHIST=$HISTSIZE
|
68
config/zsh/.zshrc
Normal file
68
config/zsh/.zshrc
Normal file
|
@ -0,0 +1,68 @@
|
|||
# mac specific configuration
|
||||
touch $HOME/.hushlogin
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
|
||||
# prepare directories
|
||||
mkdir -p $XDG_CACHE_HOME/zsh
|
||||
mkdir -p $XDG_DATA_HOME/zsh
|
||||
|
||||
# global exports and options
|
||||
setopt HIST_IGNORE_ALL_DUPS
|
||||
setopt HIST_SAVE_NO_DUPS
|
||||
setopt HIST_REDUCE_BLANKS
|
||||
setopt SHARE_HISTORY
|
||||
setopt INC_APPEND_HISTORY
|
||||
|
||||
# set path
|
||||
path=(~/.local/bin "$path[@]")
|
||||
|
||||
# source configuration
|
||||
source $ZDOTDIR/aliases.zsh
|
||||
source $ZDOTDIR/cleanhome.zsh
|
||||
source $ZDOTDIR/fzf.zsh
|
||||
source $ZDOTDIR/keys.zsh
|
||||
|
||||
# source modules
|
||||
source ~/.local/git/zsh_modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
|
||||
source ~/.local/git/zsh_modules/wd/wd.plugin.zsh
|
||||
export WD_CONFIG=$XDG_CONFIG_HOME/wd_list
|
||||
|
||||
# set fpath
|
||||
fpath=(~/.local/git/zsh_modules/wd $fpath)
|
||||
|
||||
# theme and colors
|
||||
if [[ $(command -v vivid) ]]; then
|
||||
export LS_COLORS=$(vivid generate molokai)
|
||||
else
|
||||
unset LS_COLORS
|
||||
fi
|
||||
tabs 2
|
||||
export STARSHIP_CACHE="$XDG_CACHE_HOME"/starship
|
||||
eval "$(STARSHIP_CACHE="$XDG_CACHE_HOME"/starship starship init zsh)"
|
||||
|
||||
# completion
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' list-colors ''
|
||||
|
||||
autoload -Uz compinit
|
||||
if [ ! -e $XDG_DATA_HOME/zsh/zcompdump.zwc ]; then
|
||||
autoload -Uz zrecompile
|
||||
zrecompile -p -R $XDG_DATA_HOME/zsh/zcompdump
|
||||
fi
|
||||
if [[ -n $XDG_DATA_HOME/zsh/zcompdump(#qN.mh+24) ]]; then
|
||||
compinit -d $XDG_DATA_HOME/zsh/zcompdump
|
||||
else
|
||||
compinit -C -d $XDG_DATA_HOME/zsh/zcompdump
|
||||
fi
|
||||
|
||||
# quick note functionality
|
||||
if [[ -f ~/.note ]]; then
|
||||
echo
|
||||
cat ~/.note
|
||||
echo
|
||||
fi
|
||||
|
||||
# local settings
|
||||
if [[ -f ~/.local/config/zsh ]]; then
|
||||
source ~/.local/config/zsh
|
||||
fi
|
50
config/zsh/aliases.zsh
Normal file
50
config/zsh/aliases.zsh
Normal file
|
@ -0,0 +1,50 @@
|
|||
LOCAL_GIT_DIR=${HOME}/.local/git
|
||||
|
||||
alias ga='git add .; git commit --no-edit --amend; git push --force-with-lease'
|
||||
alias gae='git add .; git commit --amend; git push --force-with-lease'
|
||||
alias less='less -R'
|
||||
|
||||
if [[ $(command -v bat) ]]; then
|
||||
alias cat='bat -pp --color=always --tabs=2 --theme=Monokai\ Extended\ Bright'
|
||||
fi
|
||||
|
||||
if [[ $(command -v eza) ]]; then
|
||||
alias ls='eza --git --octal-permissions --no-permissions --group-directories-first'
|
||||
alias ll='eza --git --octal-permissions --no-permissions --group-directories-first -l'
|
||||
else
|
||||
case $(uname -s) in;
|
||||
Darwin) alias ls='ls -G';;
|
||||
Linux) alias ls='ls --color';;
|
||||
esac
|
||||
alias ll='ls -l'
|
||||
fi
|
||||
|
||||
if [[ $(command -v fd) ]]; then
|
||||
if [[ -f ~/.local/config/fd ]]; then
|
||||
alias fd='fd -H -L --ignore-file ~/.local/config/fd'
|
||||
else
|
||||
alias fd='fd -H -L'
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $(command -v nvim) ]; then
|
||||
export EDITOR=nvim
|
||||
export MANPAGER="nvim +Man!"
|
||||
alias vim=nvim
|
||||
alias vimdiff="nvim -d"
|
||||
elif [ $(command -v vim) ] ; then
|
||||
export EDITOR=vim
|
||||
else
|
||||
export EDITOR=vi
|
||||
fi
|
||||
|
||||
if [[ $(command -v rg) ]]; then
|
||||
alias grep='rg -i'
|
||||
else
|
||||
alias grep='grep --color'
|
||||
fi
|
||||
|
||||
function ud() {
|
||||
for i in ${LOCAL_GIT_DIR}/dotfiles ${LOCAL_GIT_DIR}/zsh_modules/*; do git -C ${i} pull; done
|
||||
nvim -c "lua require('lazy').sync({wait = true})"
|
||||
}
|
2
config/zsh/cleanhome.zsh
Normal file
2
config/zsh/cleanhome.zsh
Normal file
|
@ -0,0 +1,2 @@
|
|||
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||
export LESSHISTFILE='/dev/null'
|
13
config/zsh/fzf.zsh
Normal file
13
config/zsh/fzf.zsh
Normal file
|
@ -0,0 +1,13 @@
|
|||
if [[ $(command -v fzf) ]]; then
|
||||
source <(fzf --zsh)
|
||||
export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file ~/.local/config/fd'
|
||||
export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file ~/.local/config/fd'
|
||||
export FZF_DEFAULT_OPTS="--multi -e --ansi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=Monokai\ Extended\ Bright {}'"
|
||||
export FZF_CTRL_R_OPTS="-e --ansi --layout=reverse --preview=''"
|
||||
_fzf_compgen_path() {
|
||||
fd -H -L --ignore-file ~/.local/config/fd . "$1"
|
||||
}
|
||||
_fzf_compgen_dir() {
|
||||
fd -H -L --ignore-file ~/.local/config/fd --type d . "$1"
|
||||
}
|
||||
fi
|
22
config/zsh/keys.zsh
Normal file
22
config/zsh/keys.zsh
Normal file
|
@ -0,0 +1,22 @@
|
|||
# key mode
|
||||
bindkey -e
|
||||
|
||||
# proudly stolen from oh-my-zsh
|
||||
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
|
||||
function zle-line-init() {
|
||||
echoti smkx
|
||||
}
|
||||
function zle-line-finish() {
|
||||
echoti rmkx
|
||||
}
|
||||
zle -N zle-line-init
|
||||
zle -N zle-line-finish
|
||||
fi
|
||||
if [[ -n "${terminfo[kcuu1]}" ]]; then
|
||||
autoload -U up-line-or-beginning-search
|
||||
zle -N up-line-or-beginning-search
|
||||
|
||||
bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search
|
||||
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search
|
||||
bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue