forked from maximbaz/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
115 lines (90 loc) · 3.97 KB
/
.zshrc
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
zstyle ':z4h:' auto-update no
zstyle ':z4h:*' channel stable
zstyle ':z4h:autosuggestions' forward-char accept
zstyle ':z4h:fzf-complete' fzf-command my-fzf
zstyle ':z4h:(fzf-complete|cd-down|fzf-history)' fzf-flags --no-exact --color=hl:14,hl+:14
zstyle ':z4h:(fzf-complete|cd-down)' fzf-bindings 'tab:repeat'
zstyle ':z4h:(fzf-complete|cd-down)' find-flags -name '.git' -prune -print -o -print
zstyle ':z4h:ssh:*' ssh-command command ssh
zstyle ':z4h:ssh:*' send-extra-files '~/.zsh-aliases'
zstyle ':zle:(up|down)-line-or-beginning-search' leave-cursor yes
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
zstyle ':completion:*:ssh:argument-1:' tag-order hosts users
zstyle ':completion:*:scp:argument-rest:' tag-order hosts files users
zstyle ':completion:*:(ssh|scp|rdp):*:hosts' hosts
zstyle ':z4h:ssh:*' enable yes
zstyle ':z4h:ssh:work-*' enable no
zstyle ':z4h:ssh:planet01' enable no
zstyle ':z4h:ssh:planet01-ha' enable no
zstyle ':z4h:ssh:talk*' enable no
zstyle ':z4h:ssh:corekeep' enable no
zstyle ':z4h:ssh:keep' enable no
if ! (( P9K_SSH )); then
zstyle ':z4h:sudo' term ''
fi
###
z4h install romkatv/archive || return
z4h init || return
####
zstyle ':completion:*' matcher-list "m:{a-z}={A-Z}" "l:|=* r:|=*"
####
fpath+=($Z4H/romkatv/archive)
autoload -Uz archive lsarchive unarchive edit-command-line
zle -N edit-command-line
my-fzf() {
emulate -L zsh -o extended_glob
local MATCH MBEGIN MEND
fzf "${@:/(#m)--query=?*/$MATCH }"
}
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 source -- /etc/bash_completion.d/azure-cli
z4h source -- /usr/share/nnn/quitcd/quitcd.bash_zsh
z4h source -- $ZDOTDIR/.zsh-aliases
z4h source -- $ZDOTDIR/.zshrc-private
z4h source -- $ZDOTDIR/zsh-wakatime.plugin.zsh