blob: b95a0ca3e331dec5d5d8bd3f89fe5f6b8fb8de17 (
plain) (
blame)
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
|
# plugins - fzf
# fzf is automatically picked up by /etc/profile on cygwin, but manjaro installs them here
if [[ -a /usr/share/fzf/key-bindings.zsh ]] && [[ -a /usr/share/fzf/completion.zsh ]]; then
export FZF_DEFAULT_OPTS='--no-height --no-reverse'
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
fi
# magic cd
setopt autocd
export CDPATH=".:$HOME:$HOME/devil:$HOME/src"
# just enables a bit nicer life when copy/pasting commands from docs
setopt interactive_comments
# colors in various core utils
alias diff='diff --color'
export LESS='-R'
grep_opts="--color=auto --exclude-dir=.git"
alias grep="grep $grep_opts"
alias egrep="egrep $grep_opts"
alias fgrep="fgrep $grep_opts"
unset grep_opts
if command -v exa &>/dev/null; then
alias ls='exa'
alias ll='exa --long --header --all'
elif ls --color 1>/dev/null 2>&1; then
# gnu ls
alias ls='ls --color=auto'
alias ll='ls -l --almost-all --no-group --human-readable'
else
# bsd/mac ls
export CLICOLOR='1'
alias ll='ls -hoA'
fi
# dots go up
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
# aliases
alias cls=clear
alias config='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
alias mkdir='mkdir -p'
if command -v gpg2 &> /dev/null; then
alias gpg='gpg2'
fi
if [[ "$OSTYPE" == 'cygwin' ]]; then
alias sudo='cygstart --action=runas'
fi
# collapse spaces into tabs in-place
# spacetotab <FILE> [WIDTH=4]
function spacetotab () {
unexpand --tabs=${2:-4} --first-only "$1" > "$1.tmp"
mv "$1.tmp" "$1"
}
source $ZDOTDIR/completions.zsh
source $ZDOTDIR/history.zsh
source $ZDOTDIR/vi-mode.zsh
source $ZDOTDIR/prompt.zsh
# display a fortune when opening an interactive terminal
tty -s && fortune $HOME/fortunes 2>/dev/null ||:
|