-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
83 lines (66 loc) · 1.83 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
if [[ ! -d ${ZDOTDIR:-~}/.antidote ]]; then
git clone --depth=1 \
https://github.com/mattmc3/antidote.git \
${ZDOTDIR:-~}/.antidote
fi
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
zstyle ':antidote:bundle' use-friendly-names 'yes'
antidote load
# Plugin config
# History
export HISTSIZE=1000000
export SAVEHIST=1000000
# Colorscheme
base16_railscasts
# vi-mode
export KEYTIMEOUT=1
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey -M vicmd '^v' edit-command-line
bindkey -M vicmd '^b' edit-command-line
# Starship
eval "$(starship init zsh)"
# fzf-tab
zstyle ':completion:complete:*:options' sort false
zstyle ':completion:*:git-checkout:*' sort false
zstyle ':completion:*:descriptions' format '[%d]'
zstyle ':completion:*' menu no
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always \$realpath'
fzf-tab-partial-and-complete() {
if [[ $LASTWIDGET = 'fzf-tab-partial-and-complete' ]]; then
fzf-tab-complete
else
zle complete-word
fi
}
zle -N fzf-tab-partial-and-complete
bindkey '^I' fzf-tab-partial-and-complete
# Own config
setopt extendedglob
setopt null_glob
if command -v eza > /dev/null; then
alias ls="eza --icons --group-directories-first"
alias ll="ls --long --group --header --git"
alias l="ll --all"
alias tree="eza --long --tree"
else
alias ls="ls --color=tty --group-directories-first -h"
fi
alias lsd="ls -lhd */"
if [[ $(uname) != "Darwin" ]]; then
alias open="open-background"
open-background() {
xdg-open "$@" &>/dev/null &!
}
fi
if command -v bat > /dev/null; then
alias cat="bat"
fi
if command -v nvim > /dev/null; then
alias vim="nvim"
export MANPAGER="nvim +Man!"
fi
if command -v uv > /dev/null; then
eval "$(uv generate-shell-completion zsh)"
fi