terrible commit message incoming: many changes
[~bandali/configs] / zsh / .zshrc
... / ...
CommitLineData
1# Bash-like navigation
2#export WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
3#export WORDCHARS='*?-[]~=&;!#$%^(){}<>'
4export WORDCHARS='*?[]~=&;!#$%^(){}<>'
5#ZLE_SPACE_SUFFIX_CHARS=$'|&'
6
7#disable -r time # disable shell reserved word
8#alias time='time -p' # -p for POSIX output
9
10# rehash if last command was pacaur or pacman
11# (so that zsh picks up changes in $PATH immediately)
12TRAPUSR1() { rehash}; precmd() { [[ $history[$[ HISTCMD -1 ]] == *(pacaur|pacman)* ]] && killall -USR1 zsh }
13
14#
15# User configuration sourced by interactive shells
16#
17
18# Change default zim location
19export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
20
21# Start zim
22[[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh
23
24ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
25#ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold'
26
27setopt globdots
28
29source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
30source ~/.zsh/zsh-autopair/autopair.zsh
31
32
33### fzf ###
34
35source /usr/share/fzf/key-bindings.zsh
36source /usr/share/fzf/completion.zsh
37
38# Accept history selection instead of putting it on
39# the command line
40fzf-history-widget-accept() {
41 fzf-history-widget
42 zle accept-line
43}
44#zle -N fzf-history-widget-accept
45#bindkey '^R' fzf-history-widget-accept
46
47# alt+c preview
48export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"
49
50### fzf ###
51
52
53# aliases
54alias mpv="mpv --ytdl-format mp4"
55alias mv="mv -iv"
56alias cp="cp -iv"
57alias scl=systemctl
58alias jcl=journalctl
59alias m="mbsync -Va; getmail; notmuch new"
60alias best="youtube-dl -f best"
61alias ace="mosh amin@ace.aminb.org"
62alias nix="ssh amin@aminb.org"
63
64aur() {
65 cd ~/usr/build
66 git clone https://aur.archlinux.org/${1}.git
67 cd ${1}
68}
69
70# i-beam cursor
71echo -e "\033[5 q"
72#echo -e "\033[6 q"