-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
165 lines (128 loc) · 4.78 KB
/
dot_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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.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
### 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 _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
### ==============================
# Load pure theme
zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh'
zinit light sindresorhus/pure
zi for \
atload"zicompinit; zicdreplay" \
blockf \
lucid \
wait \
zsh-users/zsh-completions
# OMZ completion-style
zstyle ':completion:*' menu select
zstyle :prompt:pure:path color '#ea9b2c'
zstyle :prompt:pure:prompt:success color '#29dcfb'
zstyle :prompt:pure:prompt:error color '#e13f00'
zstyle :prompt:pure:execution_time color '#d9c68d'
zstyle :prompt:pure:git:dirty color '#0098ff'
# Plugin loaded with investigating.
zi light zdharma-continuum/history-search-multi-word
zi light zdharma-continuum/fast-syntax-highlighting
zi light zsh-users/zsh-history-substring-search
# SHELL config END
# ===================
# https://unix.stackexchange.com/questions/389881/history-isnt-preserved-in-zsh
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory
# Traps and binds
# -----------------
# omitted: / ( ) _ - =
# added: " '
export WORDCHARS="*?.[]~&;!#$%^{}<>'\""
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
# https://unix.stackexchange.com/questions/5293/how-do-i-jump-to-the-next-or-previous-word-with-ctrl-arrow-keys-in-a-console
# Enable Ctrl+arrow key bindings for word jumping
bindkey '^[[1;5C' forward-word # Ctrl+right arrow
bindkey '^[[1;5D' backward-word # Ctrl+left arrow
# https://github.com/zsh-users/zsh-history-substring-search
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
# -----------
# PATH Setup
# -----------
export VOLTA_HOME="$HOME/.volta"
PATH="$VOLTA_HOME/bin:$PATH"
PATH="./bin:$PATH"
PATH="$HOME/.local/bin:$PATH"
# add locally built git-cinnabar
# with makefile two symbolic links to git-cinnabar and git remote-hg are created so we target the source directory only
PATH="$HOME/git/rust/lapce/target/release:$PATH"
PATH="$HOME/git/rupost/desktop/git-cinnabar:$PATH"
# doomemacs
PATH="$HOME/.config/emacs/bin:$PATH"
# flutter
PATH="/usr/bin/flutter/bin/:$PATH"
# ----------
# PATH END
# ----------
alias tx='tar --extract --file'
# taskfile
# -------------------
alias t='task'
# rust-related
# -------------------
alias cr='cargo'
alias crr='cargo run'
alias crb='cargo build'
# git
# ------------------
alias g='git'
# REMINDER: git also available as g
# git logs a cool-looking tree of oneleined commits
alias ggraph='git log --oneline --all --graph --decorate'
# git logs cool-looking tree of every commit with metadata (author and stuff)
alias ggraph-w-authors='git log --all --graph --decorate'
alias gfetch='git fetch --all --tags'
alias greset='git reset --hard'
alias gclean='git clean -fdx'
alias gsd='git diff --submodule=log'
alias glog='git log --oneline --decorate --graph'
alias glog-self='git log --author="$(git config user.name)"'
alias gsu='git submodule update'
alias gsf='git submodule update --force --rebase'
alias glog-lines='function _search_by_lines(){git log -L"$2","$3":"$1";};_search_by_lines'
alias v='vim'
alias fk='flatpak'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias cz='chezmoi'
# zig C/C++ compiler replacement
alias zcc="zig cc"
alias zcxx="zig c++"
export PATH
# scrollable less output with a wheel
export LESS=-R
# ~/.cache/sccache size
export SCCACHE_CACHE_SIZE=60G
# Wasmer
export WASMER_DIR="/home/kayman/.wasmer"
[ -s "$WASMER_DIR/wasmer.sh" ] && source "$WASMER_DIR/wasmer.sh"