-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
91 lines (71 loc) · 3.76 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
# p10k instant prompt {{
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 #}}
# plugins {{
PLUG_REPO=~/.znap
[[ -r $PLUG_REPO/znap/znap.zsh ]] ||
git clone --depth 1 -- https://github.com/marlonrichert/zsh-snap.git $PLUG_REPO/znap
source $PLUG_REPO/znap/znap.zsh
znap source romkatv/powerlevel10k
znap source zsh-users/zsh-autosuggestions
znap source zsh-users/zsh-syntax-highlighting
znap source marlonrichert/zsh-autocomplete
znap source agkozak/zsh-z #}}
alias cat="batcat --style=plain --color=always --paging=never "
alias icat="kitty +kitten icat --align left"
alias ls="ls --color"
alias yp='noglob yt-dlp -v -S "+codec:h264" -o "%(uploader)s - %(playlist)s/%(playlist_index)s - %(title)s.%(ext)s"'
alias yf='noglob yt-dlp -v -S "+codec:h264" --output-na-placeholder "" -f "bv[ext=mp4]*+ba/bv*+ba/b" --sponsorblock-remove default -o "%(uploader)s - %(title)s.%(ext)s"'
PATH=~/.local/bin:$PATH
LESS="-iMFXRas" # main thing - colorize less and print if fits one screen, to exit hg diff immediately for short files.
EDITOR=/usr/bin/vim
DOTNET_CLI_TELEMETRY_OPTOUT=true
KITTY_INSTALLATION_DIR=$HOME/.local/kitty.app/lib/kitty/
# binds {{
bindkey '^[[3~' delete-char # enables DEL key proper behaviour
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
bindkey "^[[H" beginning-of-line # [Home] - goes at the begining of the line
bindkey "^[[F" end-of-line # [End] - goes at the end of the line
autoload -z edit-command-line # Enable editing of command line by pressing Ctrl+x, E
zle -N edit-command-line
bindkey '^Xe' edit-command-line #}}
# fzf settings {{
FZF_DEFAULT_OPTS="--height 30 --ansi --layout=reverse --preview 'echo {} | batcat --color=always --language=bash --style=plain' --preview-window down:7:wrap"
if [ -d /usr/share/doc/fzf/examples ]; then
source /usr/share/doc/fzf/examples/key-bindings.zsh
source /usr/share/doc/fzf/examples/completion.zsh
fi # }}
# autosuggest {{
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=5"
ZSH_AUTOSUGGEST_STRATEGY=(history completion) #}}
# history {{
setopt share_history # share history between terminals
setopt hist_ignore_dups # do not enter command if it is same as previous command
setopt histignorespace
HISTSIZE=50000 # How many lines of history to keep in memory
HISTFILE=~/.zsh_history # Where to save history to disk
SAVEHIST=5000000 # Number of history entries to save to disk }}
[[ ! -f ~/.work.zshrc ]] || source ~/.work.zshrc # load work setting, that I don't want to put to source control
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
# kitty shell integration {{
if [ -d "$KITTY_INSTALLATION_DIR" ]; then
export KITTY_SHELL_INTEGRATION="no-sudo enabled"
autoload -Uz -- "$KITTY_INSTALLATION_DIR"/shell-integration/zsh/kitty-integration
kitty-integration
unfunction kitty-integration
fi
# }}
# zsh-autocomplete settings {{
zstyle ':autocomplete:*complete*:*' insert-unambiguous yes
zstyle ':autocomplete:*history*:*' insert-unambiguous yes
zstyle ':autocomplete:menu-search:*' insert-unambiguous yes
zstyle ':autocomplete:*' widget-style menu-select
zstyle ':autocomplete:*' list-lines 16
zstyle ':autocomplete:*' fzf-completion yes
zstyle ':completion:*:*' matcher-list 'm:{[:lower:]-}={[:upper:]_}' '+r:|[.]=**'
bindkey '^I' menu-complete
bindkey "$terminfo[kcbt]" reverse-menu-complete
##}}
# vim:foldmethod=marker:foldmarker={{,}}:foldlevel=0:foldtext=substitute(getline(v\:foldstart),'\\#\\\ \\\|{{','','g')