-
Notifications
You must be signed in to change notification settings - Fork 37
/
zshrc
175 lines (163 loc) · 6.39 KB
/
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
#!/bin/zsh
# vim: set foldmarker=<<,>> foldlevel=0 foldmethod=marker:
#===================================================================================
# DESCRIPTION: You realize, Dr. Angelo, that my intelligence has surpassed yours.
# AUTHOR: Jarrod Taylor
# .__
# ________ _____| |_________ ____
# \___ / / ___/ | \_ __ \_/ ___\
# / / \___ \| Y \ | \/\ \___
# /_____ \/____ >___| /__| \___ >
# \/ \/ \/ \/
#
#===================================================================================
#
eval "$(/opt/homebrew/bin/brew shellenv)"
# Source the prompt <<1
#-------------------------------------------------------------------------------
if [[ ! -n "$ZSHRUN" ]]; then
source $HOME/.zsh_prompt
fi
# Precmd functions local array variable <<2
#-------------------------------------------------------------------------------
local -a precmd_functions
# >>2
# Precmd functions <<2
#------------------------------------------------------------------------------
# Run precmd functions so we get our pimped out prompt
#------------------------------------------------------------------------------
precmd_functions=( precmd_prompt )
# >>2
# >>1
# General Settings <<1
# Autoload tab completion <<2
#-------------------------------------------------------------------------------
autoload -U compinit
compinit -C
# >> 2
# Modify default zsh directory coloring on ls commands <<2
#-------------------------------------------------------------------------------
export LSCOLORS=gxfxcxdxbxegedabagacad
# >>2
# Completion settings <<2
#-------------------------------------------------------------------------------
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' list-colors "$LS_COLORS"
zstyle -e ':completion:*:(ssh|scp|sshfs|ping|telnet|nc|rsync):*' hosts '
reply=( ${=${${(M)${(f)"$(<~/.ssh/config)"}:#Host*}#Host }:#*\**} )'
# >>2
# Set the desired setup options man zshoptions <<2
#-------------------------------------------------------------------------------
# If command can't be executed, and command is name of a directory, cd to directory
setopt auto_cd
# Make cd push the old directory onto the directory stack.
setopt auto_pushd
# Safety for overwriting files use >| instead of > to over write files
setopt noclobber
# Prevents aliases on the command line from being internally substituted before
# completion is attempted. The effect is to make the alias a distinct command
# for completion purposes.
setopt complete_aliases
# Treat the #, ~ and ^ characters as part of patterns for filename
# generation, etc. (An initial unquoted `~' always produces named directory
# expansion.)
setopt extended_glob
# If a new command line being added to the history list duplicates an older one,
# the older command is removed from the list (even if it is not the previous event).
setopt hist_ignore_all_dups
# Remove command lines from the history list when the first character on the line
# is a space, or when one of the expanded aliases contains a leading space.
setopt hist_ignore_space
# This option both imports new commands from the history file, and also
# causes your typed commands to be appended to the history file
setopt share_history
setopt noflowcontrol
# When listing files that are possible completions, show the type of each file
# with a trailing identifying mark.
setopt list_types
# Append a trailing / to all directory names resulting from filename
# generation (globbing).
setopt mark_dirs
# Perform a path search even on command names with slashes in them.
# Thus if /usr/local/bin is in the user's path, and he or she types
# X11/xinit, the command /usr/local/bin/X11/xinit will be executed
# (assuming it exists).
setopt path_dirs
# If set, `%' is treated specially in prompt expansion.
setopt prompt_percent
# If set, parameter expansion, command substitution and arithmetic
# expansion are performed in prompts.
# Substitutions within prompts do not affect the command status.
setopt prompt_subst
# >>2
# History settings <<2
#-------------------------------------------------------------------------------
HISTFILE=$HOME/.zsh_history
HISTFILESIZE=65536 # search this with `grep | sort -u`
HISTSIZE=4096
SAVEHIST=4096
REPORTTIME=60 # Report time statistics for progs that take more than a minute to run
# >>2
# utf-8 in the terminal, will break stuff if your term isn't utf aware <<2
#-------------------------------------------------------------------------------
export LANG=en_US.UTF-8
export LC_ALL=$LANG
export LC_COLLATE=C
# >>2
# Set grepoptions <<2
#-------------------------------------------------------------------------------
export GREP_OPTIONS='--color=auto'
# >>2
# Use the correct ctags <<2
#-------------------------------------------------------------------------------
PATH="~/.pyenv/shims:/usr/local/bin:$PATH"
# >>2
# Editor and display configurations <<2
#-------------------------------------------------------------------------------
export EDITOR='vim'
export VISUAL='vim'
export GIT_EDITOR=$EDITOR
export LESS='-imJMWR'
export PAGER="less $LESS"
export MANPAGER=$PAGER
export GIT_PAGER=$PAGER
export BROWSER='chromium-browser'
# >>2
#
# Eliminate lag between transition from normal/insert mode <<2
#-------------------------------------------------------------------------------
# If this causes issue with other shell commands it can be raised default is 4
export KEYTIMEOUT=1
# >>2
# >>1
# Key Bindings <<1
#-------------------------------------------------------------------------------
# Set vi-mode and create a few additional Vim-like mappings
#-------------------------------------------------------------------------------
bindkey -v
bindkey '^R' history-incremental-search-backward
bindkey '^R' history-incremental-pattern-search-backward
bindkey '^?' backward-delete-char
bindkey '^H' backward-delete-char
# >>1
# Aliases <<1
#-------------------------------------------------------------------------------
if [ "$(uname)" = "Darwin" ]; then
alias ls='ls -FHG'
else
alias ls='ls -F --color'
fi
# >>1
# Source Syntaxhighlighting <<1
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# >>1
# Source Default Configurations <<1
for fname in $(find ~/dotfiles/default-configs -name "*.sh*"); do
source $fname
done
# >>1
# Source Custom Configurations <<1
for fname in $(find ~/dotfiles/custom-configs -name "*.sh*"); do
source $fname
done
# >>1