dotfiles/data/zsh/extra-zshrc

99 lines
2.6 KiB
Plaintext
Raw Normal View History

2022-12-01 03:42:39 +00:00
# Put this in ~/.zshrc
# source ~/.config/zsh/extra-zshrc
# https://zsh.sourceforge.io/Doc/Release/Parameters.html#Parameters-Used-By-The-Shell
export HISTORY_IGNORE="(ls|ll|la|cd|pwd|exit)"
export HISTSIZE=100000000
export SAVEHIST=$HISTSIZE
# https://zsh.sourceforge.io/Doc/Release/Options.html
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_NO_FUNCTIONS
setopt HIST_NO_STORE
setopt HIST_REDUCE_BLANKS
setopt HIST_SAVE_NO_DUPS
# https://stackoverflow.com/q/12382499
bindkey "^[[1;3C" forward-word
bindkey "^[[1;3D" backward-word
2023-03-01 07:02:23 +00:00
# omz
2023-03-16 08:43:03 +00:00
zstyle ':omz:update' mode disabled
2023-03-01 07:02:23 +00:00
# https://github.com/ohmyzsh/ohmyzsh/issues/5700
DISABLE_AUTO_TITLE="true"
# https://github.com/ohmyzsh/ohmyzsh/issues/10291
DISABLE_UNTRACKED_FILES_DIRTY="true"
# https://github.com/ohmyzsh/ohmyzsh/issues/5569
DISABLE_MAGIC_FUNCTIONS="true"
2022-12-01 03:42:39 +00:00
# nvim
2023-03-16 08:43:03 +00:00
if command -v nvim &>/dev/null; then
export EDITOR=nvim
export VISUAL=nvim
export GIT_EDITOR=nvim
2023-05-07 07:44:31 +00:00
alias vi="nvim"
alias vim="nvim"
fi
2022-12-01 03:42:39 +00:00
# go
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# Depend on your company
# Please copy this manually to ~/.zshrc
2023-01-22 14:06:31 +00:00
export GOPRIVATE=github.com/make-go-great,github.com/haunt98
2022-12-01 03:42:39 +00:00
# fzf
# https://github.com/junegunn/fzf#environment-variables
2023-04-19 09:58:24 +00:00
if command -v fzf &>/dev/null; then
if command -v fd &>/dev/null; then
export FZF_DEFAULT_COMMAND="fd --type file"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type directory"
fi
2022-12-01 03:42:39 +00:00
2023-04-19 09:58:24 +00:00
# https://github.com/catppuccin/fzf
export FZF_DEFAULT_OPTS=" \
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8"
fi
2022-12-01 03:42:39 +00:00
# Alias
alias g="git"
alias moe="make"
2023-03-11 11:14:13 +00:00
# https://zellij.dev/documentation/faq.html
2023-03-16 08:43:03 +00:00
if command -v zellij &>/dev/null; then
alias zz="zellij"
2023-03-11 11:14:13 +00:00
fi
2022-12-01 03:42:39 +00:00
# https://sw.kovidgoyal.net/kitty/faq/
2023-04-19 09:58:24 +00:00
if command -v kitty &>/dev/null; then
alias kssh="kitty +kitten ssh"
fi
2023-01-13 16:29:19 +00:00
2023-01-22 14:06:31 +00:00
# https://restic.readthedocs.io/en/latest/manual_rest.html
2023-04-19 09:58:24 +00:00
if command -v restic &>/dev/null; then
export RESTIC_PASSWORD_FILE=$HOME/.restic_password_file
fi
2023-01-22 14:06:31 +00:00
# https://github.com/sharkdp/vivid
2023-03-16 08:43:03 +00:00
if command -v vivid &>/dev/null; then
export LS_COLORS="$(vivid generate catppuccin-mocha)"
fi
2023-03-16 08:27:23 +00:00
2023-04-19 09:58:24 +00:00
# https://github.com/jarun/nnn
if command -v nnn &>/dev/null; then
export NNN_FIFO=/tmp/nnn.fifo
export NNN_PLUG="p:-preview-tui"
2023-04-19 09:58:24 +00:00
fi
2023-05-07 11:33:36 +00:00
# https://gitlab.com/phoneybadger/pokemon-colorscripts
if command -v pokemon-colorscripts &>/dev/null; then
pokemon-colorscripts --no-title -r 1-8
2023-03-16 08:27:23 +00:00
fi