forked from maximbaz/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
106 lines (80 loc) · 3.74 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
zstyle ':z4h:' auto-update no
zstyle ':z4h:' start-tmux no
zstyle ':z4h:' term-shell-integration yes
zstyle ':z4h:' propagate-cwd yes
zstyle ':z4h:*' channel stable
zstyle ':z4h:autosuggestions' forward-char accept
zstyle ':z4h:fzf-complete' fzf-command my-fzf
zstyle ':z4h:(fzf-complete|fzf-dir-history|fzf-history)' fzf-flags --no-exact --color=hl:14,hl+:14
zstyle ':z4h:(fzf-complete|fzf-dir-history)' fzf-bindings 'tab:repeat'
zstyle ':z4h:fzf-complete' find-flags '(' -name '.git' -o -name node_modules ')' -prune -print -o -print
zstyle ':z4h:ssh:*' enable no
zstyle ':z4h:ssh:*' ssh-command command ssh
zstyle ':z4h:ssh:*' term 'xterm-256color'
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 ':z4h:direnv' enable yes
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
if ! (( P9K_SSH )); then
zstyle ':z4h:sudo' term ''
fi
###
[ ! -f /etc/motd ] || cat /etc/motd
###
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
###
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 backward-kill-line Ctrl+U
z4h bindkey kill-line Alt+U
z4h bindkey kill-whole-line Alt+I
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-fzf-dir-history Alt+J
z4h bindkey my-ctrl-z Ctrl+Z
z4h bindkey edit-command-line Alt+E
z4h bindkey z4h-eof Ctrl+D
###
setopt GLOB_DOTS
setopt IGNORE_EOF
###
[ -z "$EDITOR" ] && export EDITOR='vim'
[ -z "$VISUAL" ] && export VISUAL='vim'
export DIRENV_LOG_FORMAT=
export FZF_DEFAULT_OPTS="--reverse --multi"
export SYSTEMD_LESS="${LESS}S"
###
z4h source -- /etc/bash_completion.d/azure-cli
z4h source -- /usr/share/LS_COLORS/dircolors.sh
z4h source -- $ZDOTDIR/.zsh-aliases
z4h source -- $ZDOTDIR/.zshrc-private