forked from sorin-ionescu/prezto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
119 lines (93 loc) · 3.73 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
116
117
118
119
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <[email protected]>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/init.zsh"
fi
# Customize to your needs...
source "${ZDOTDIR:-$HOME}/aliases"
fpath=(~/.config/zsh/completions $fpath)
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_MANUAL_REBIND=true
unsetopt CORRECT
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz compinit
compinit -u
# following lines are not required after above lines (probably)
# autoload -Uz _zinit
# (( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
### End of Zinit's installer chunk
zinit snippet OMZ::plugins/git/git.plugin.zsh
zinit light skywind3000/z.lua
# ZVM
function zvm_config() {
ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
# ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLOCK
ZVM_LAZY_KEYBINDINGS=true
# ZVM_VI_INSERT_ESCAPE_BINDKEY=kj
}
zinit ice depth=1
zinit light jeffreytse/zsh-vi-mode
ctrl_l() {
builtin print -rn -- $'\r\e[0J\e[H\e[22J' >"$TTY"
builtin zle .reset-prompt
builtin zle -R
}
zle -N ctrl_l
WORDCHARS=${WORDCHARS//-.}
# The plugin will auto execute this zvm_after_init function
function zvm_after_init() {
[ -f ~/.config/zsh/fzf.zsh ] && source ~/.config/zsh/fzf.zsh
bindkey '^b' backward-word
bindkey '^f' forward-word
bindkey '^g' autosuggest-accept
# allow ctrl-r and ctrl-s to search the history
# bindkey '^r' history-incremental-search-backward
# bindkey '^s' history-incremental-search-forward
# allow ctrl-a and ctrl-e to move to beginning/end of line
bindkey '^a' beginning-of-line
bindkey '^e' end-of-line
bindkey '^l' ctrl_l
# allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour)
bindkey '^h' backward-kill-word
bindkey '^w' backward-kill-word
bindkey -s '^Z' "fg\n"
bindkey '^x' fzf-cd-widget
# bindkey "\e\e" fuck-command-line
bindkey "\e[1;3D" dirhistory_zle_dirhistory_back
bindkey "\e[1;3C" dirhistory_zle_dirhistory_future
bindkey "\e[1;3A" dirhistory_zle_dirhistory_up
bindkey "\e[1;3B" dirhistory_zle_dirhistory_down
}
export PYENV_ROOT="$HOME/.pyenv"
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"