[emacs] enable exec-path-from-shell
[~bandali/configs] / zsh / .zshrc
CommitLineData
855ca243
AB
1# Bash-like navigation
2#export WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
56fe4497
AB
3#export WORDCHARS='*?-[]~=&;!#$%^(){}<>'
4export WORDCHARS='*?[]~=&;!#$%^(){}<>'
149b29f1 5#ZLE_SPACE_SUFFIX_CHARS=$'|&'
855ca243 6
af0337b0
AB
7#disable -r time # disable shell reserved word
8#alias time='time -p' # -p for POSIX output
8b2a2e9c 9
855ca243
AB
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
855ca243
AB
14#
15# User configuration sourced by interactive shells
16#
17
56fe4497
AB
18# Change default zim location
19export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
855ca243 20
56fe4497
AB
21# Start zim
22[[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh
855ca243
AB
23
24ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
25#ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold'
26
56fe4497
AB
27setopt globdots
28
855ca243 29source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
161c93e9 30source ~/.zsh/zsh-autopair/autopair.zsh
d0ef45b9 31
56fe4497
AB
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
d0ef45b9
AB
53# aliases
54alias mpv="mpv --ytdl-format mp4"
55alias mv="mv -iv"
56alias cp="cp -iv"
378dacde
AB
57alias scl=systemctl
58alias jcl=journalctl
8b2a2e9c 59alias m="mbsync -Va; getmail; notmuch new"
161c93e9 60alias best="youtube-dl -f best"
149b29f1 61alias ace="mosh amin@ace.aminb.org"
61777d7d 62alias nix="ssh amin@aminb.org"
61777d7d 63
61777d7d
AB
64aur() {
65 cd ~/usr/build
66 git clone https://aur.archlinux.org/${1}.git
67 cd ${1}
68}
56fe4497
AB
69
70# i-beam cursor
71echo -e "\033[5 q"
72#echo -e "\033[6 q"