dotfiles/data/zsh/bottom-zshrc

165 lines
4.2 KiB
Plaintext
Raw Normal View History

2023-08-05 19:29:17 +00:00
# vim: set filetype=zsh:
2023-07-17 04:50:01 +00:00
# Put this on bottom of ~/.zshrc
2023-07-07 17:25:25 +00:00
2024-02-29 20:33:47 +00:00
# https://github.com/ohmyzsh/ohmyzsh/wiki/Settings#automatic-title
ZSH_THEME_TERM_TITLE_IDLE="%~"
ZSH_THEME_TERM_TAB_TITLE_IDLE="%~"
2024-01-23 17:21:20 +00:00
# https://github.com/romkatv/powerlevel10k#how-do-i-configure-instant-prompt
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
# https://github.com/romkatv/powerlevel10k#mitigation
typeset -g POWERLEVEL9K_TERM_SHELL_INTEGRATION=true
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
2024-02-06 05:04:22 +00:00
# Alias
alias g="git"
alias moe="make"
alias meo="make"
# https://wiki.archlinux.org/title/XDG_Base_Directory
export XDG_CONFIG_HOME=~/.config
export XDG_CACHE_HOME=~/.cache
export XDG_DATA_HOME=~/.local/share
2023-10-06 08:03:33 +00:00
# https://www.topbug.net/blog/2016/09/27/make-gnu-less-more-powerful/
export LESS="-RF -i -K -s -x2 --wordwrap"
# git
# https://stackoverflow.com/a/43747486
export GIT_COMPLETION_CHECKOUT_NO_GUESS=1
2022-12-01 03:42:39 +00:00
# nvim
2023-03-16 08:43:03 +00:00
if command -v nvim &>/dev/null; then
2024-04-04 10:04:12 +00:00
export EDITOR=nvim
export VISUAL=nvim
export GIT_EDITOR=nvim
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-08-05 19:29:17 +00:00
# export GOPRIVATE=example.company.com
2022-12-01 03:42:39 +00:00
# fzf
2023-08-06 07:26:21 +00:00
# https://github.com/junegunn/fzf
2023-04-19 09:58:24 +00:00
if command -v fzf &>/dev/null; then
2024-04-04 10:04:12 +00:00
export FZF_COMPLETION_TRIGGER='~~'
2024-01-23 17:05:57 +00:00
2024-04-04 10:04:12 +00:00
if command -v fd &>/dev/null; then
_fzf_compgen_path() {
fd --type file . "$1"
}
2024-01-23 17:05:57 +00:00
2024-04-04 10:04:12 +00:00
_fzf_compgen_dir() {
fd --type directory . "$1"
}
2024-01-23 17:05:57 +00:00
2024-04-04 10:04:12 +00:00
export FZF_DEFAULT_COMMAND="fd --type file --color=always"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type directory --color=always"
fi
2022-12-01 03:42:39 +00:00
2024-04-04 10:04:12 +00:00
# https://github.com/catppuccin/fzf
export FZF_DEFAULT_OPTS="\
2024-01-23 17:05:57 +00:00
--ansi \
--pointer='🔫' --prompt='🪓 ' \
2023-08-05 19:29:17 +00:00
--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"
2023-10-29 15:40:07 +00:00
2024-04-04 10:04:12 +00:00
if command -v bat &>/dev/null; then
export FZF_CTRL_T_OPTS="--preview 'bat --color=always --line-range=:500 {}'"
fi
2023-10-29 15:40:07 +00:00
2024-04-04 10:04:12 +00:00
if command -v eza &>/dev/null; then
export FZF_ALT_C_OPTS="--preview 'eza --tree --level 1 {}'"
fi
2023-04-19 09:58:24 +00:00
fi
2022-12-01 03:42:39 +00:00
2024-01-16 14:50:48 +00:00
# https://github.com/BurntSushi/ripgrep
if command -v rg &>/dev/null; then
2024-04-04 10:04:12 +00:00
export RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/ripgreprc"
2024-01-16 14:50:48 +00:00
fi
2023-10-29 15:40:07 +00:00
# https://github.com/eza-community/eza
if command -v eza &>/dev/null; then
2024-04-04 10:04:12 +00:00
alias ls="eza"
alias la="eza -la"
alias lt="eza --tree"
2023-10-29 15:40:07 +00:00
fi
# https://github.com/wilfred/difftastic
if command -v difft &>/dev/null; then
2024-04-04 10:04:12 +00:00
export DFT_DISPLAY=inline
export DFT_TAB_WIDTH=2
fi
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
2024-04-04 10:04:12 +00:00
export RESTIC_PASSWORD_FILE=$HOME/.restic_password_file
2023-04-19 09:58:24 +00:00
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
2024-04-04 10:04:12 +00:00
export LS_COLORS="$(vivid generate catppuccin-mocha)"
fi
2023-03-16 08:27:23 +00:00
2024-02-10 16:56:53 +00:00
# https://github.com/ajeetdsouza/zoxide
if command -v zoxide &>/dev/null; then
2024-04-04 10:04:12 +00:00
eval "$(zoxide init zsh)"
2024-02-10 16:56:53 +00:00
fi
# https://github.com/walles/moar
if command -v moar &>/dev/null; then
2024-04-04 10:04:12 +00:00
export MOAR="-no-linenumbers -no-statusbar -quit-if-one-screen -wrap"
export PAGER=moar
fi
2024-02-10 16:56:53 +00:00
# https://github.com/atuinsh/atuin
if command -v atuin &>/dev/null; then
2024-04-04 10:04:12 +00:00
eval "$(atuin init zsh --disable-up-arrow)"
2024-02-10 16:56:53 +00:00
fi
# https://github.com/extrawurst/gitui
if command -v gitui &>/dev/null; then
2024-04-04 10:04:12 +00:00
alias gu="gitui"
fi
2024-02-10 16:56:53 +00:00
# https://github.com/Schniz/fnm
if command -v fnm &>/dev/null; then
2024-04-04 10:04:12 +00:00
eval "$(fnm env --use-on-cd)"
2024-02-10 16:56:53 +00:00
fi
# https://github.com/pyenv/pyenv
if command -v pyenv &>/dev/null; then
2024-04-04 10:04:12 +00:00
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
2024-03-10 18:06:52 +00:00
fi
2024-02-10 16:56:53 +00:00
# Depend on your company
# https://github.com/ankitpokhrel/jira-cli
# Remember to jira init local not cloud
export JIRA_AUTH_TYPE=bearer
2023-08-21 17:19:18 +00:00
# https://github.com/talwat/pokeget-rs
2023-10-28 20:08:04 +00:00
rand_poke=$((RANDOM % 6))
2023-08-19 11:25:12 +00:00
if [[ $rand_poke -eq 0 ]]; then
2024-04-04 10:04:12 +00:00
cat ~/.config/pokeget/pikachu.txt
2023-08-19 11:25:12 +00:00
elif [[ $rand_poke -eq 1 ]]; then
2024-04-04 10:04:12 +00:00
cat ~/.config/pokeget/clefairy.txt
2023-08-19 11:25:12 +00:00
elif [[ $rand_poke -eq 2 ]]; then
2024-04-04 10:04:12 +00:00
cat ~/.config/pokeget/ditto.txt
2023-08-19 11:25:12 +00:00
elif [[ $rand_poke -eq 3 ]]; then
2024-04-04 10:04:12 +00:00
cat ~/.config/pokeget/chikorita.txt
2023-10-28 20:08:04 +00:00
elif [[ $rand_poke -eq 4 ]]; then
2024-04-04 10:04:12 +00:00
cat ~/.config/pokeget/eevee.txt
2023-10-28 20:08:04 +00:00
elif [[ $rand_poke -eq 5 ]]; then
2024-04-04 10:04:12 +00:00
cat ~/.config/pokeget/squirtle.txt
2023-08-19 11:25:12 +00:00
fi