-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc_global.sh
90 lines (73 loc) · 3.27 KB
/
.zshrc_global.sh
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
86
87
88
89
# .zshrc
# vim: set syntax=sh:
# Emacs stuff
# Local Variables:
# mode: sh
# End:
emulate sh -c ". ${HOME}/.shrc"
# Originally sourced from: https://github.com/voku/dotfiles/blob/397e31eaa57b385bc761a4859d58a65c4f1eb6fd/.redpill/lib/1_options.zsh#L54
# ===== History opts
# Allow multiple terminal sessions to all append to one zsh command history
setopt APPEND_HISTORY
# Save each command’s beginning timestamp (in seconds since the epoch) and the duration (in seconds) to the history file
setopt EXTENDED_HISTORY
# Add commands as they are typed, don't wait until shell exit
setopt INC_APPEND_HISTORY
# If the internal history needs to be trimmed to add the current command line, setting this option will cause the oldest history event that has a duplicate to be lost before losing a unique event
setopt HIST_EXPIRE_DUPS_FIRST
# Do not enter command lines into the history list if they are duplicates of the previous event
setopt HIST_IGNORE_DUPS
# remove command lines from the history list when the first character on the line is a space
setopt HIST_IGNORE_SPACE
# When searching history don't display results already cycled through twice
setopt HIST_FIND_NO_DUPS
# remove the history (fc -l) command from the history list when invoked
setopt HIST_NO_STORE
# remove superfluous blanks from each command line being added to the history list
setopt HIST_REDUCE_BLANKS
# whenever the user enters a line with history expansion, don’t execute the line directly
setopt HIST_VERIFY
# Allow command substitution in prompt string
setopt PROMPT_SUBST
# ===== History envars
# Max number of items to persist into history
SAVEHIST=1000
# History file location
HISTFILE=~/.zsh_history
# # The following lines were auto-generated by compinstall
#
# zstyle ':completion:*' completer _complete _ignored
# zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
# zstyle :compinstall filename '/Users/eestrada/.zshrc'
#
# # End of lines added by compinstall
# Custom terminal prompt
# In zsh, $PROMPT can be used in the place of $PS1
PROMPT='[%n@%m %F{blue}%3~%f]'
PROMPT="${PROMPT}%F{yellow}\$(_tmux_print_status)%f"
PROMPT="${PROMPT}%F{green}\$(_git_print_branch)%f"
# Always add newline
PROMPT="$PROMPT"$'\n'
# Trailing character of PROMPT determined on whether we are currently root or not
case `id -u` in
0) PROMPT="${PROMPT}# ";;
*) PROMPT="${PROMPT}$ ";;
esac
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
export FPATH
[ -r "${HOME}/.dotfile_misc/macos/iterm2/shell_integration.zsh" ] && . "${HOME}/.dotfile_misc/macos/iterm2/shell_integration.zsh"
[[ "$TERM_PROGRAM" == "vscode" ]] && type code &>/dev/null && . "$(code --locate-shell-integration-path zsh)"
[ -f ~/.config/fzf/setup.zsh ] && source ~/.config/fzf/setup.zsh
# This seems to work best when it is the last thing called.
autoload -Uz compinit && compinit
# This echos some parse errors to the terminal and might not be worth enabling.
autoload -U +X bashcompinit && bashcompinit && . "${HOME}/.bash_completion" >/dev/null 2>&1
# source local shell overrides and additions
for _LOCAL_OVERRIDES in "${HOME}/.zshrc_local" "${HOME}/.zshrc_local.sh" "${HOME}/.zshrc-local.sh"
do
[ -r "${_LOCAL_OVERRIDES}" ] && . "${_LOCAL_OVERRIDES}"
done
unset _LOCAL_OVERRIDES