-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
80 lines (59 loc) · 1.95 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
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(git zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
# Fix for when pasting large buffers for autosuggestions
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
# History fixes
export SAVEHIST=50000
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
# Preferred editor for local and remote sessions
export EDITOR='vim'
BASEDIR="$HOME/.dotfiles"
source "$BASEDIR/zsh/alias.sh"; # Extra Alias's
prompt_dir() {
prompt_segment blue black '%2~' # Only show 2 dirs.
}
prompt_context() {
# Only show the first char of the username
prompt_segment black white "%(!.%{%F{yellow}%}.)$USER[1]@%m"
}
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
prompt_context
prompt_dir
prompt_end
}
git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "(%{$fg_bold[black]%}${ref#refs/heads/}%{${reset_color}%})"
}
RPROMPT='$(git_prompt_info)'
# FZF Plugin
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
signon # re-enable Git commit signing on every session
# Source for local machine overrides
if [ -e "$HOME/.zshrc-local" ]; then
source "$HOME/.zshrc-local";
fi
if [ -e "$HOME/.zshrc-secret" ]; then
source "$HOME/.zshrc-secret";
fi
if [ -e /Users/nickw/.nix-profile/etc/profile.d/nix.sh ]; then
source $HOME/.nix-profile/etc/profile.d/nix.sh;
fi # added by Nix installer