-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
85 lines (64 loc) · 2.47 KB
/
dot_zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# TODO: styling: use " or '
if [[ -n "${DEBUG_ZSH_STARTUP_TIME:-}" ]]; then
zmodload zsh/zprof
fi
DENO_INSTALL="${HOME}/.local/share/deno"
if [ -d "${DENO_INSTALL}" ]; then
export DENO_INSTALL
export PATH="${DENO_INSTALL}/bin:${PATH}"
fi
export PATH="${HOME}/.local/bin:${PATH}"
# NOTE: should be before antigen
export NVM_DIR=~/.local/share/nvm
# TODO: move antigen to ~/.local/share
source "${HOME}/.antigen/antigen.zsh"
antigen init ~/.antigenrc
# NOTE: Install theme for fast-syntax-highlighting
fast-theme base16 &> /dev/null
for ZSH_CONFIG_FILE in ~/.config/zsh/*; do
source "${ZSH_CONFIG_FILE}"
done
if [ -x "$(command -v fzf)" ]; then
source /usr/share/fzf/shell/key-bindings.zsh
fi
# TODO: extract to a file
# https://github.com/chrisduerr/dotfiles/blob/master/files/zsh/alias.zsh
alias grfb='git checkout master && git pull --rebase && git checkout - && git rebase master'
alias gcfb='git checkout master && git pull --rebase && git checkout -b'
alias code='flatpak run com.vscodium.codium'
# NOTE: provided by zpm-zsh/clipboard plugin
alias clipboard='clip'
# NOTE: --->
# based on
# https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
alias path='echo -e ${PATH//:/\\n}'
# <---
# NOTE: should be after nvm
export NODE_PATH="$(npm root -g):${NODE_PATH}"
# TODO: fzf: extract to a file
# NOTE: -->
FZF_PREVIEW_FILE="bat --color=always --style=numbers {}"
FZF_PREVIEW_DIR="tree --dirsfirst -L 3 -C {}"
FZF_PREVIEW_OPTS="--preview '([[ -f {} ]] && ${FZF_PREVIEW_FILE}) || ([[ -d {} ]] && ${FZF_PREVIEW_DIR})'"
export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix --hidden --follow --exclude .git"
export FZF_DEFAULT_OPTS="--multi --cycle --info inline --layout reverse --height 80%"
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
export FZF_CTRL_T_OPTS="${FZF_PREVIEW_OPTS}"
export FZF_ALT_C_OPTS="${FZF_PREVIEW_OPTS}"
_fzf_compgen_path() {
fd --hidden --follow --exclude ".git" . "$1"
}
_fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
# TODO: Disable Ctrl-R fzf variant
# TODO: Setup fuzzy completion
# https://github.com/junegunn/fzf#fuzzy-completion-for-bash-and-zsh
# TODO: Setup ripgrep
# https://github.com/junegunn/fzf/blob/master/ADVANCED.md#using-fzf-as-interactive-ripgrep-launcher
# TODO: Setup key bindings
# https://betterprogramming.pub/boost-your-command-line-productivity-with-fuzzy-finder-985aa162ba5d
# <---
if [[ -n "${DEBUG_ZSH_STARTUP_TIME:-}" ]]; then
zprof
fi