-
Notifications
You must be signed in to change notification settings - Fork 2
/
dot_zshrc
47 lines (37 loc) · 1.36 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
# Per function profiling
# zmodload zsh/zprof
# Per command profiling
# zmodload zsh/datetime
# setopt promptsubst
# PS4='+$EPOCHREALTIME %N:%i> '
# exec 3>&2 2>startlog.$$
# setopt xtrace prompt_subst
stty -ixon -ixoff # disable ctrl-s and ctrl-q
bindkey -e # Emacs keybinding
source $HOME/.shell/options
source $HOME/.shell/tools
source $HOME/.shell/bindings
if [[ "$OSTYPE" =~ "darwin" ]]; then
# when put in zshenv it gets overwritten by tmux which calls /etc/profile again (login shell)
export PATH=$HOME/Library/Python/3.11/bin:/opt/homebrew/opt/gnu-tar/libexec/gnubin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/Cellar/coreutils/9.1/libexec/gnubin:/opt/homebrew/bin:/opt/homebrew/opt/mysql-client/bin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH
fi
autoload -Uz compinit
compinit -d # needed for fpath completions to work
trap_exit_tmux() {
# switch only when current session has only one window and one pane
if [ "$(tmux list-panes | wc -l)" -eq 1 ] && [ "$(tmux list-windows | wc -l)" -eq 1 ]; then
tmux switch-client -t default
fi
}
if [[ $- == *i* ]]; then
# activate trap only when inside tmux and not inside Neovim terminal (in tmux)
if [[ $TERM_PROGRAM == "tmux" && -z $NVIM ]]; then
trap trap_exit_tmux EXIT
fi
fi
# Per-command profiling:
# unsetopt xtrace
# exec 2>&3 3>&-
# Per-function profiling
# zprof
# vim: filetype=sh