-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold-zshrc
214 lines (186 loc) · 5.89 KB
/
old-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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
fpath=($HOME/.zfunctions $HOME/.zcompletions $fpath)
autoload -Uz compinit && compinit
autoload -Uz add-zsh-hook
# autoload -Uz vcs_info
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_SAVE_NO_DUPS
setopt HIST_VERIFY
setopt APPEND_HISTORY
setopt HIST_NO_STORE
# Use vim bindings, but keep C-a and C-e from emacs.
bindkey -v
bindkey '^A' beginning-of-line
bindkey '^E' end-of-line
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search
setopt AUTO_CD
setopt CD_SILENT
setopt AUTO_LIST
setopt NO_AUTO_MENU
setopt NO_MENU_COMPLETE
setopt CASE_GLOB
setopt CASE_MATCH
CDPATH=::$HOME:$HOME/Documents/git-repos/trinity:$HOME/Documents/git-repos:$HOME/Documents
# # Style the vcs_info message
# zstyle ':vcs_info:*' enable git
# zstyle ':vcs_info:*' max-exports 3
# zstyle ':vcs_info:git*' formats '%b' '%u%c' '%.8i'
# # Format when the repo is in an action (merge, rebase, etc)
# zstyle ':vcs_info:git*' actionformats '{%*}'
# # check-for-changes can be slow on large repos.
# zstyle ':vcs_info:git*' check-for-changes true
# zstyle ':vcs_info:git*' get-revision true
# zstyle ':vcs_info:git*' unstagedstr '*'
# zstyle ':vcs_info:git*' stagedstr '+'
#
# function _update_vcs_info_msg() {
# vcs_info
#
# if [[ -z ${vcs_info_msg_0_} ]]; then
# PROMPT='%3~ %# '
# else
# local -a messages
# local git_info
#
# local remote_status=''
# local base=$(git merge-base HEAD @{u} 2>/dev/null)
# local aref=$(git rev-parse HEAD 2>/dev/null)
# local bref=$(git rev-parse @{u} 2>/dev/null)
# if [[ $aref == $bref ]]; then
# remote_status='='
# elif [[ $aref == $base ]]; then
# remote_status='<'
# elif [[ $bref == $base ]]; then
# remote_status='>'
# else
# remote_status='<>'
# fi
#
# if [[ -n "$(git ls-files --others --exclude-standard 2>/dev/null)" ]]
# then
# untracked='%%'
# else
# untracked=''
# fi
#
# messages+="${vcs_info_msg_0_}"
# vcs_info_msg_1_="${vcs_info_msg_1_}${untracked}"
# if [[ -n "$vcs_info_msg_1_" ]]; then
# messages+="${vcs_info_msg_1_}${remote_status}"
# else
# messages+="${remote_status}"
# fi
# messages+="${vcs_info_msg_2_}"
#
# git_info="${(j: :)messages}"
#
# PROMPT="%3~ {${git_info}}%# "
# fi
# }
# add-zsh-hook precmd _update_vcs_info_msg
# PROMPT='%3~ ${vcs_info_msg_0_}%# '
# source /opt/local/share/git/contrib/completion/git-prompt.sh
# get_sha() {
# git rev-parse --short HEAD 2>/dev/null
# }
#
# GIT_PS1_SHOWDIRTYSTATE=1
# GIT_PS1_SHOWSTASHSTATE=1
# GIT_PS1_SHOWUNTRACKEDFILES=1
# GIT_PS1_DESCRIBE_STYLE="branch"
# GIT_PS1_SHOWUPSTREAM="auto git"
#
# precmd() {
# __git_ps1 '%3~ ' '%# ' "{%s $(get_sha)}"
# }
# PROMPT='%3~ $(__git_ps1 "{%s $(get_sha)}")%# '
zstyle ':completion:*:make:*:targets' call-command true
zstyle ':completion:*:*:make:*' tag-order 'targets'
# if [[ -d $HOME/.fzf/shell ]]; then
# source "$HOME/.fzf/shell/completion.zsh"
# source "$HOME/.fzf/shell/key-bindings.zsh"
# fi
#
# if type rg &> /dev/null; then
# export FZF_DEFAULT_COMMAND='rg --files --hidden'
# export FZF_DEFAULT_OPTS="
# --height 40%
# --layout=reverse
# --border
# --bind '?:toggle-preview'
# --preview-window=:hidden
# --preview='less {}'
# --no-color "
# fi
#
# zle -N fzf-cd-widget
# bindkey '\C-j' fzf-cd-widget
if [[ -d $HOME/local/lua ]]; then
LUA_PATH='/Users/telemachus/local/lua/share/lua/5.1/?.lua;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/Users/telemachus/.luarocks/share/lua/5.1/?.lua;/Users/telemachus/.luarocks/share/lua/5.1/?/init.lua;/Users/telemachus/local/lua/share/lua/5.1/?/init.lua'
LUA_CPATH='./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;/Users/telemachus/.luarocks/lib/lua/5.1/?.so;/Users/telemachus/local/lua/lib/lua/5.1/?.so'
fi
# Disable color on ls and also add handy aliases
alias l='ls --color=none'
alias ll='l -l'
alias la='l -A'
alias lf='l -CF'
alias l.='l -d .[^.]* 2>/dev/null'
alias l.f='l -F -d .[^.]* 2>/dev/null'
alias l.l='l -ld .[^.]* 2>/dev/null'
# Aliases for safety
alias rmi='rm -i'
alias rmp='rm -P'
alias cpi='cp -i'
alias mvi='mv -i'
# Aliases for clarity
alias cpv='cp -v'
alias rmv='rm -v'
alias mvv='mv -v'
# Make my life easier
alias cpr='cp -r'
# A few git aliases
alias gs='git status -sb'
alias g.='gs .'
alias gd='git diff'
alias gdh='git diff HEAD'
alias gl='git pull'
alias gp='git push'
# View current playlist with numbers
alias nlist='mpc playlist | cat -n -'
# Lock my screen quickly
alias lock='/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend'
# reindex spotlight
alias respotlight='sudo mdutil -E /'
# convenience invocation of head
alias one='head -n1'
# Make life simpler
alias words='wc -w'
# neomutt > mutt
alias mutt=neomutt
# find executables: see this comment on Stack Overflow.
# https://bit.ly/3BRvXjT
# For an alternative, see this answer on Stack Overflow.
# https://stackoverflow.com/a/4458361/26702
alias findexecs='find . -type f -perm -a=x'
# daily updates
alias morning='sudo portup ; neoup'
# eval "$(starship init zsh)"
ZSH_GIT_PROMPT_SHOW_STASH=1
# ZSH_GIT_PROMPT_SHOW_UPSTREAM_NAME=1
PROMPT='%3~ $(gitprompt)%# '
source ~/.config/zsh/git-prompt.zsh/git-prompt.zsh
source ~/Downloads/src/zsh-prompt-benchmark/zsh-prompt-benchmark.plugin.zsh
# vim: set ts=8 sw=4 et tw=80 ft=zsh :