-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
127 lines (105 loc) · 2.86 KB
/
zshrc
File metadata and controls
127 lines (105 loc) · 2.86 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH
source $HOME/.cargo/env
#===== Prompt
setopt PROMPT_SUBST
autoload -U colors && colors
PR_USER='%F{green}%n%f'
PR_USER_OP='%F{green}%#%f'
PR_PROMPT='%f$ %f'
if [[ $UID -eq 0 ]]; then
PR_USER='%F{red}%n%f'
PR_USER_OP='%F{red}%#%f'
PR_PROMPT='%F{red}# %f'
fi
PR_HOST='%F{red}%m%f'
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then
PR_HOST='%F{yellow}%m%f'
fi
local user_host="${PR_USER}%F{cyan}@${PR_HOST}"
local current_dir="%B%F{blue}%~%f%b"
PROMPT="${user_host}:${current_dir} ${PR_PROMPT}"
#===== Shell Config
HISTFILESIZE=-1
HISTSIZE=1000000000
SAVEHIST=1000000000
HISTCONTROL=ignoredups
HISTFILE=~/.zsh_history.rob
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_VERIFY
setopt HIST_EXPAND
setopt AUTO_CD
# emacs keybindings
bindkey -e
#===== Completion
# Add some completions settings
setopt ALWAYS_TO_END
setopt AUTO_LIST
setopt AUTO_MENU
setopt AUTO_PARAM_SLASH
setopt COMPLETE_IN_WORD
setopt MENU_COMPLETE
setopt GLOB_COMPLETE
setopt EXTENDED_GLOB
autoload -Uz compinit && compinit
zstyle ':completion:*' menu select
zstyle ':completion:*' list-suffixes zstyle ':completion:*' expand prefix suffix
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' rehash true
zstyle ':completion::complete:*' use-cache true
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
bindkey '^[[Z' reverse-menu-complete
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey '^[[A' history-beginning-search-backward-end
bindkey '^[[B' history-beginning-search-forward-end
bindkey "^P" up-line-or-search
bindkey "^N" down-line-or-search
#===== Env & Aliases
export EDITOR="nvim"
export VISUAL="nvim"
alias t="tree"
alias e="$EDITOR"
alias grep="grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}"
alias egrep="grep -E"
alias ls="ls --color=auto"
alias la="ls -a"
alias ll="ls -alh"
alias lru="ls -alrh"
alias ...="cd ../../"
alias ....="cd ../../../"
alias f1="awk '{print \$1}'"
alias f2="awk '{print \$2}'"
alias f3="awk '{print \$3}'"
alias f4="awk '{print \$4}'"
function etemp() {
local tmpfile="$(mktemp)"
echo "Opening tempfile at $tmpfile"
$EDITOR "$tmpfile"
}
#====== Quick Nav
alias docs="cd ~/Documents"
alias proj="cd ~/Projects"
alias dl="cd ~/Downloads"
alias dots="cd ~/dotfiles"
alias ~="cd ~/"
alias ee="e ~/.zshrc && source ~/.zshrc"
alias eee="e ~/.config/nvim"
#======== Git Binds
alias gita="git add"
alias gitc="git commit"
alias gitca="git commit -a"
alias gitco="git checkout"
alias gitf="git fetch"
alias gitl="git log"
alias gitp="git pull"
alias gitpu="git push"
alias gitr="git rebase"
alias gits="git status"
alias gitd="git diff"
alias gite="git show"
alias gitb="git branch"