-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
47 lines (38 loc) · 1.17 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
# antigen
source $HOME/antigen.zsh
antigen init ~/.antigenrc
antigen apply
__wezterm_set_user_var() {
if hash base64 2>/dev/null ; then
if [[ -z "${TMUX}" ]] ; then
printf "\033]1337;SetUserVar=%s=%s\007" "$1" `echo -n "$2" | base64`
else
# <https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it>
# Note that you ALSO need to add "set -g allow-passthrough on" to your tmux.conf
printf "\033Ptmux;\033\033]1337;SetUserVar=%s=%s\007\033\\" "$1" `echo -n "$2" | base64`
fi
fi
}
function _run_prog() {
# set PROG to the program being run
__wezterm_set_user_var "PROG" "$1"
# arrange to clear it when it is done
trap '__wezterm_set_user_var PROG ""' EXIT
# and now run the corresponding command, taking care to avoid looping
# with the alias definition
command "$@"
}
alias vim="_run_prog vim"
alias tmux="_run_prog tmux"
alias nvim="_run_prog nvim"
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
else
autoload -Uz compinit
compinit
fi
compdef _run_prog=nvim
export MANPAGER='nvim +Man!'
alias lg="lazygit"