-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot.zshrc
98 lines (84 loc) · 2.27 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
DOTS="${DOTS:-${HOME}/.dots}"
# Profile startup
zmodload zsh/zprof
# Autocomplete
# TODO: Add more stuff in here as needed, this is very basic.
zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.cache/zsh/completion
autoload -Uz compinit && compinit
# Highlighting
source ${DOTS}/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Terminal title & prompt
source ${DOTS}/zsh/title.zsh
source ${DOTS}/zsh/prompt.zsh
# History
setopt SHARE_HISTORY
setopt HIST_IGNORE_DUPS
HISTFILE=~/.zsh_history
SAVEHIST=10000
HISTSIZE=10000
# Directory Stuff
setopt AUTO_PUSHD
setopt PUSHD_SILENT
setopt EXTENDED_GLOB
# Key Bindings
bindkey -e
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
bindkey '^[[3;5~' kill-word
bindkey '^H' backward-kill-word
# Aliases
if [[ "${OSTYPE}" == linux* ]]; then
alias ls='ls --group-directories-first --color=auto'
fi
alias ll='ls -l'
alias la='ls -al'
alias br='git br'
alias st='git st'
alias dus='du -sk | sort -n'
alias gdb='gdb -silent'
alias vimf='vim $(fzf)'
#alias vimf='vim $(fzf --preview "bat --line-range :150 --color always {}")'
alias vimcommit='vim $(git files | xargs echo)'
alias tmuxa='tmux new-session -AD -s'
alias tmuxl='tmux list-sessions'
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
# FZF
export FZF_DEFAULT_COMMAND='fd --type f'
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse'
if [[ -e /usr/share/doc/fzf/examples/key-bindings.zsh ]]; then
source /usr/share/doc/fzf/examples/key-bindings.zsh
fi
# Random stuff
export BLOCK_SIZE="'1"
export BAT_THEME=Solarized-dark
if [[ "${OSTYPE}" == darwin* ]]; then
export BROWSER='open'
fi
setopt NO_BG_NICE
autoload -U zargs
autoload -U zcalc
autoload -U zmv
# dircolors
if hash dircolors &>/dev/null; then
if [[ -e "${HOME}/.dir_colors/dircolors" ]]; then
eval `dircolors "${HOME}/.dir_colors/dircolors"`
else
eval `dircolors --sh`
fi
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
fi
# Less
export LESS='-g -i -M -R -S -w -z-4'
if hash lesspipe &>/dev/null; then
export LESSOPEN="| lesspipe %s 2>&-"
fi
function mkcdir () {
mkdir -p -- "$1" && cd -- "$1"
}
compdef mkcdir=mkdir
if [[ -e ${HOME}/.custom/zshrc ]]; then
source ${HOME}/.custom/zshrc
fi