-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpreload.zsh
68 lines (56 loc) · 2.33 KB
/
preload.zsh
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
# Preload Sergii's plugin.
# Add before sourcing oh-my-zsh:
# if [[ -f "${ZSH}/custom/plugins/zsh-sergiis-plugin/preload.zsh" ]]; then
# source "${ZSH}/custom/plugins/zsh-sergiis-plugin/preload.zsh"
# fi
# omz settings
zstyle ':omz:lib:theme-and-appearance' gnu-ls yes
# Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
# Fix word navigation
# When forward-navigation words, don't skip over the last character
# https://github.com/zsh-users/zsh/blob/master/Functions/Zle/select-word-style
# https://github.com/zsh-users/zsh/blob/master/Functions/Zle/forward-word-match
autoload -U select-word-style
select-word-style bash
### Plugins config
# https://github.com/zsh-users/zsh-autosuggestions#suggestion-highlight-style
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=247,bold"
# Use bat instead of colored-man-pages plugin
export MANPAGER="sh -c 'col -bx | bat -l man -p --theme=\"Monokai Extended\" --pager=\"less --jump-target=10 --status-column\"'"
export DELTA_PAGER="less --jump-target=0"
# FZF
export FZF_BASE=/opt/local/share/fzf
export FZF_DEFAULT_OPTS='--layout=reverse --border'
export FZF_COMPLETION_TRIGGER='~~'
# https://github.com/junegunn/fzf/wiki/Configuring-shell-key-bindings
# ? for log line preview window
export FZF_CTRL_R_OPTS="--preview='echo {}'\
--preview-window='down:3:hidden:wrap'\
--bind='?:toggle-preview,alt-enter:become(echo {q})'\
"
# --bind='?:toggle-preview,alt-enter:accept-or-print-query'\
# "cd into the selected directory"
# Disable so escape-c (my common mistake) doesn't start indexing everything.
FZF_ALT_C_COMMAND=""
# "Paste the selected files and directories onto the command-line"
FZF_CTRL_T_COMMAND=""
# Because completions is in unusual place
# export DISABLE_FZF_AUTO_COMPLETION='true'
# source /opt/local/share/zsh/site-functions/_fzf
# source /opt/local/share/fzf/shell/completion.zsh
# Tmux
# export ZSH_TMUX_ITERM2=true
# export ZSH_TMUX_FIXTERM=false
# export ZSH_TMUX_FIXTERM_WITHOUT_256COLOR=xterm
# export ZSH_TMUX_FIXTERM_WITH_256COLOR=xterm-256color
# Load local profile
source "${HOME}/.profile"