-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshr
84 lines (62 loc) · 2.33 KB
/
.zshr
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
zstyle ':z4h:' auto-update no
zstyle ':z4h:*' channel stable
zstyle ':z4h:autosuggestions' forward-char accept
zstyle ':fzf-tab:*' continuous-trigger tab
zstyle ':zle:(up|down)-line-or-beginning-search' leave-cursor no
zstyle ':z4h:term-title:ssh' preexec '%* | %n@%m: ${1//\%/%%}'
zstyle ':z4h:term-title:local' preexec '%* | ${1//\%/%%}'
zstyle ':zle:up-line-or-beginning-search' leave-cursor true
zstyle ':zle:down-line-or-beginning-search' leave-cursor true
###
z4h install romkatv/archive || return
z4h init || return
####
fpath+=($Z4H/romkatv/archive)
autoload -Uz archive lsarchive unarchive edit-command-line
zle -N edit-command-line
my-ctrl-z() {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
zle accept-line -w
else
zle push-input -w
zle clear-screen -w
fi
}
zle -N my-ctrl-z
toggle-sudo() {
[[ -z "$BUFFER" ]] && zle up-history -w
if [[ "$BUFFER" != "sudo "* ]]; then
BUFFER="sudo $BUFFER"
CURSOR=$(( CURSOR + 5 ))
else
BUFFER="${BUFFER#sudo }"
fi
}
zle -N toggle-sudo
###
z4h bindkey z4h-backward-kill-word Ctrl+Backspace
z4h bindkey z4h-backward-kill-zword Ctrl+Alt+Backspace
z4h bindkey z4h-kill-zword Ctrl+Alt+Delete
z4h bindkey z4h-forward-zword Ctrl+Alt+Right
z4h bindkey z4h-backward-zword Ctrl+Alt+Left
z4h bindkey z4h-cd-back Alt+H
z4h bindkey z4h-cd-forward Alt+L
z4h bindkey z4h-cd-up Alt+K
z4h bindkey z4h-cd-down Alt+J
z4h bindkey toggle-sudo Alt+S
z4h bindkey my-ctrl-z Ctrl+Z
z4h bindkey edit-command-line Alt+E
###
setopt GLOB_DOTS
###
[ -z "$EDITOR" ] && export EDITOR='vim'
[ -z "$VISUAL" ] && export VISUAL='vim'
export DIRENV_LOG_FORMAT=
export FZF_DEFAULT_OPTS="--reverse --multi"
export SYSTEMD_LESS=FRXMK
###
command -v direnv &> /dev/null && eval "$(direnv hook zsh)"
###
z4h compile -- $ZDOTDIR/{.zshenv,.zprofile,.zshrc,.zlogin,.zlogout}
# patch -Np1 -i ~/.dotfiles/z4h.patch -r /dev/null -d $Z4H/zsh4humans/