-
Notifications
You must be signed in to change notification settings - Fork 12
/
.zshrc.local
163 lines (121 loc) · 4.93 KB
/
.zshrc.local
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
zstyle ':completion:*:*:(v|vim|nvim):*:*files' ignored-patterns '*.(a|dylib|so|o|pyc)'
zstyle ':completion:*' menu select=1 # show highlight regardless of number of files
if [[ "${SSH_CONNECTION}" ]]; then
zstyle ':prompt:grml:*:items:user' pre '%F{red}'
fi
setopt EXTENDED_GLOB
# show the destination of symbolic links instead of its name
setopt CHASE_LINKS
# don't remove trailing slash after completing a dir
#setopt no_auto_remove_slash
unsetopt beep
zmodload zsh/complist
# Note: When adding to PATH here, make sure files are on the SSD to speed up executable lookups
export PATH=~/.local/bin:$PATH
export WINEPREFIX=/media/samsung/wine/
export EDITOR=nvim
export PAGER=nvimpager
# confirm deleting files
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias grepi='grep -i'
alias strace="strace -tt -yy"
alias devdl="devd -l -x '**/*{.bak,.txt,.ml,.cmt,.cmx,.cmi,.cmo,.native,_digests,_log,.depends,.o,.byte,.where,.db,.digest-db,.to-delete-in-source-tree,.universe-state,log}' ."
alias disass="objdump -M intel -d"
alias dmesg='dmesg -T'
alias hexdump='hexdump -C'
# print page number
alias pdfgrep="pdfgrep -n"
alias icat="kitty +kitten icat"
alias netstatty="netstat -lpute --numeric-ports"
export FZF_DEFAULT_COMMAND="rg --files -g '!node_modules' -g '!_build' -g '!*.cm[ijtx]' -g '!*.mlast{,.d}'"
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
alias utop='utop-full -implicit-bindings'
alias reboot="echo 'su -c reboot'"
alias shutdown="echo 'su -c shutdown'"
alias gl="git log"
alias gs="git status"
alias gd="git diff"
#export OPAMKEEPBUILDDIR=true
#export OPAMBUILDDOC=true # not used, requires to compile odoc before anything else: https://github.com/ocaml/opam-repository/issues/15710
export OPAMKEEPBUILDDIR=true
export OPAMPINKINDAUTO=0
#export OCAMLPARAM="_,bin-annot=1"
export TOPKG_CONF_DEBUGGER_SUPPORT=true # install sources, may break nocrypto compilation
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
#prompt off
#PS1='%B%n %~%% %b'
#RPS1='%?'
MAILCHECK=0
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.config/fabric.plugin.zsh
# set terminal title
precmd () {print -Pn "\e]0;%n@%m: %d\a"}
# ctrl+enter to accept from menu but stay in menu
#bind2maps menuselect -- -s '^M' accept-and-menu-complete
# ctrl+n to run mkdir -p on the directory under the cursor
bind2maps emacs viins -- -s '^n' inplaceMkDirs
bindkey -v
bindkey ';5D' emacs-backward-word
bindkey ';5C' emacs-forward-word
WORDCHARS=${WORDCHARS//[&=\/;!#%\{]}
#eval $(dircolors ~/.config/dircolours)
export LS_COLORS='no=00:fi=00:di=34:ow=34;40:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;33:';
export KEYTIMEOUT=1
bindkey "^W" backward-kill-word
bindkey "^H" backward-delete-char # Control-h also deletes the previous char
bindkey "^U" backward-kill-line
bindkey "^?" backward-delete-char
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 "$terminfo[kcuu1]" up-line-or-beginning-search
bindkey "$terminfo[kcud1]" down-line-or-beginning-search
unsetopt listambiguous
unsetopt share_history
setopt incappendhistory # write to .zsh_history file immediately
setopt noclobber
alias longest="awk 'length > m { m = length; a = NR } END { print a }'"
alias fab='fab --fabfile=~/ocaml/honeypot/controller/fabfile.py'
#alias fab='python -m fabric --fabfile=~/ocaml/honeypot/controller/fabfile.py'
alias vim='nvim -p'
alias vimdiff='nvim -d'
alias mutt='neomutt'
alias objdump='objdump -M intel'
test -r $HOME/.opam/opam-init/init.zsh && . $HOME/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
unsetopt histignorealldups # record complete history
#ZSH_HIGHLIGHT_STYLES[path]=none
#ZSH_HIGHLIGHT_STYLES[path_prefix]=none
export WGETRC=~/.config/wgetrc
#export XDG_CONFIG_HOME=~/.config
#export VIMINIT='let $MYVIMRC="/home/fabian/.config/vim/vimrc" | source $MYVIMRC'
export GNUPGHOME=~/.config/gnupg
export ELINKS_CONFDIR=~/.config/elinks
export IPYTHONDIR=~/.config/ipython
export GOPATH=~/.local/go
export NODE_REPL_HISTORY=~/.cache/node_repl_history
export PYTHONSTARTUP=~/.config/pythonrc.py
export NPM_CONFIG_USERCONFIG=~/.config/npm/npmrc
export DOCKER_CONFIG=~/.config/docker
export RANDFILE=~/.cache/randfile
export MBLAZE=~/.config/mblaze
export RUSTUP_HOME=~/.cache/rustup
export SQLITE_HISTORY=/tmp/sqlite_history
export CARGO_HOME=~/.cache/cargo
export PACKER_CONFIG_DIR=~/.config/packer
export PACKER_CACHE_DIR=~/.cache/packer
export RLWRAP_HOME=~/.cache/rlwrap
export PERF_CONFIG=~/.config/perf
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot=~/.cache/java
export AQBANKING_HOME=~/.config/aqbanking
export LESSHISTFILE=/dev/null
export MYPY_CACHE_DIR=~/.cache/mypy
alias gdb='gdb -q -nh -x ~/.config/gdb/init'