forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathzshrc
More file actions
103 lines (90 loc) · 2.87 KB
/
zshrc
File metadata and controls
103 lines (90 loc) · 2.87 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
export LANG=en_US.UTF-8
export EDITOR='vim'
# aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias 1='cd -'
alias 2='cd -2'
alias 3='cd -3'
alias 4='cd -4'
alias 5='cd -5'
alias 6='cd -6'
alias 7='cd -7'
alias 8='cd -8'
alias 9='cd -9'
alias grep='rg'
alias gr='rg'
alias ls='eza'
alias l='eza -la --smart-group --git --git-repos-no-status'
alias md='mkdir -p'
alias t='tmux attach -t 0 || tmux new'
alias tt='tmux attach -t 0-1 || tmux new -t 0'
alias which-command=whence
alias k="kubectl"
alias c="batcat"
# vi mode
bindkey -v
zle -N edit-command-line
autoload -Uz edit-command-line
bindkey -M vicmd 'V' edit-command-line
bindkey "^R" history-incremental-search-backward
bindkey "^N" history-beginning-search-forward
bindkey "^P" history-beginning-search-backward
bindkey "^[OA" history-beginning-search-backward
bindkey "^[OB" history-beginning-search-forward
bindkey "^[OC" vi-forward-char
bindkey "^[OD" vi-backward-char
bindkey "^[OF" vi-end-of-line
bindkey "^[OH" vi-beginning-of-line
bindkey "^[[200~" bracketed-paste
bindkey "^[[2~" overwrite-mode
bindkey "^[[3~" vi-delete-char
bindkey "" backward-delete-char
# completion
zstyle ':completion:*' menu select
fpath+=~/.zsh/completions
fpath+=~/.zfunc
autoload -U compinit; compinit
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
# prompt
fpath+=~/.zsh/pure
autoload -U promptinit; promptinit
zstyle :prompt:pure:user color 'green'
zstyle :prompt:pure:host color 'green'
zstyle :prompt:pure:user:root color 'red'
zstyle :prompt:pure:prompt:success color 'blue'
zstyle :prompt:pure:git:branch color '172' # orange
zstyle :prompt:pure:virtualenv color 'cyan'
prompt pure
# history
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000
SAVEHIST=10000
setopt extended_history # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space
setopt hist_verify # show command with history expansion to user before running it
setopt inc_append_history # add commands to HISTFILE in order of execution
setopt share_history # share command history data
# colors
eval `dircolors ~/.zsh/dircolors/dircolors.ansi-dark`
# auto cd
setopt auto_cd
# caps as additional escape (to work at startup, put it in ~/.profile)
if (( ${+DISPLAY} )) && command -v dconf >/dev/null 2>&1; then
dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:escape']"
fi
# source local zsh
[ -f ~/.zshrc.local ] && source ~/.zshrc.local
# disable scroll lock
stty -ixon
# add bin to path
path+=~/.local/bin
path+=~/bin
export PATH
# vim:set et sw=4 ts=4 fdm=expr fde=getline(v\:lnum)=~'^#'?'>1'\:'=' fdl=0 :