-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
67 lines (53 loc) · 2.15 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
setopt SHARE_HISTORY
source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
export PATH="$PATH:$HOME/.local/bin:$HOME/.cargo/bin"
eval "$(mise activate zsh)"
eval "$(zoxide init zsh)"
eval "$(atuin init zsh)"
eval "$(starship init zsh)"
eval "$(fzf --zsh)"
# export CARAPACE_BRIDGES='zsh,bash'
# zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
# source <(carapace _carapace)
export SSLKEYLOGFILE="$HOME/.ssl-key.log"
export TERM=xterm-256color
export GIT_EDITOR=hx
export VISUAL="$(which hx)"
export EDITOR="$VISUAL"
export SUDO_EDITOR="$VISUAL"
export AZ_AUTO_LOGIN_TYPE="DEVICE"
export XPAUTH_PATH="$HOME/src/smartbidder/xpauth_dev.xpr"
# replacements for existing commands
alias ls="eza"
alias cat="batcat"
alias find="fdfind"
alias fix="git diff --name-only | uniq | xargs $EDITOR"
alias tree="ls --tree --color always | cat"
function wiki {
hx -w ~/wiki ~/wiki/index.md
}
function most-recent-tag {
git pull --tags && git describe --tags $(git rev-list --tags --max-count=5)
}
function search {
rm -f /tmp/rg-fzf-{r,f}
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="${*:-}"
FZF_DEFAULT_COMMAND="$RG_PREFIX $(printf %q "$INITIAL_QUERY")" \
fzf --ansi \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--disabled --query "$INITIAL_QUERY" \
--bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \
--bind "ctrl-f:unbind(change,ctrl-f)+change-prompt(2. fzf> )+enable-search+rebind(ctrl-r)+transform-query(echo {q} > /tmp/rg-fzf-r; cat /tmp/rg-fzf-f)" \
--bind "ctrl-r:unbind(ctrl-r)+change-prompt(1. ripgrep> )+disable-search+reload($RG_PREFIX {q} || true)+rebind(change,ctrl-f)+transform-query(echo {q} > /tmp/rg-fzf-f; cat /tmp/rg-fzf-r)" \
--bind "start:unbind(ctrl-r)" \
--prompt '1. ripgrep> ' \
--delimiter : \
--header '╱ CTRL-R (ripgrep mode) ╱ CTRL-F (fzf mode) ╱' \
--bind='tab:toggle-preview' \
--preview 'batcat --color=always {1}' \
--preview-window 'right,60%,border-bottom,+{2}+3/3,~3' \
--bind 'enter:become(hx {1}:{2})'
}
. "$HOME/.atuin/bin/env"