-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshenv
55 lines (52 loc) · 2.18 KB
/
.zshenv
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
alias dotfiles-env='GIT_DIR="$HOME"/.dotfiles/ GIT_WORK_TREE="$HOME"'
alias dotfiles='dotfiles-env git'
alias dotfiles-rg=$'dotfiles ls-files "$HOME" | parallel ls -F | rg --invert-match \'@$\' | parallel --tty --xargs rg'
alias fd='fd --follow --hidden --exclude ".git"'
alias ga='git add'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias gco='git checkout'
alias gd='git diff'
alias gds='git -c delta.features=side-by-side diff'
alias gf='git fetch --all --tags'
alias gfp='git merge-base --fork-point origin/master'
alias gp='git push'
alias grb='git rebase'
alias gsh='git show'
alias gst='git status'
alias gup='git pull'
alias gupp=$'git fetch --all --prune --tags && git rebase @{u} && git branch -vv | awk \'/: gone]/{print $1}\' | xargs git branch --delete --force'
alias llnl='ll node_modules | rg " -> "'
alias pd="afplay /System/Library/Sounds/Glass.aiff && terminal-notifier -title 'Process Completed' -message 'Get back to work.'"
alias rsync=$'rsync --cvs-exclude --filter=\':- ~/.gitignore\''
alias uvpiplistoutdated=$'bash -c "uv pip list --format=freeze | sed \'s/==.*//\' | uv pip compile - --no-deps --no-header | delta --diff-args=\'-U0\' --hunk-header-style=\'omit\' --side-by-side <(uv pip list --format=freeze) - || :"'
export FZF_DEFAULT_COMMAND='rg --files --follow --glob "!.git/*"'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export RIPGREP_CONFIG_PATH="$HOME/.rgrc"
# Support zoxide in Vim command mode, which isn't an interactive shell by
# default. It's okay if `zoxide` isn't found. Outside of Vim, starting a new
# shell, it may not be on the PATH yet.
if [ "$(command -v zoxide)" ]; then
eval "$(zoxide init zsh)"
fi
# fco - checkout git branch/tag
fco() {
local tags branches target
tags=$(
git tag | awk '{print "\x1b[31;1mtag\x1b[m\t" $1}'
) || return
branches=$(
git branch --all | grep -v HEAD |
sed "s/.* //" | sed "s#remotes/[^/]*/##" |
sort -u | awk '{print "\x1b[34;1mbranch\x1b[m\t" $1}'
) || return
target=$(
(
echo "$tags"
echo "$branches"
) |
fzf-tmux -- --no-hscroll --ansi +m -d "\t" -n 2
) || return
git checkout "$(echo "$target" | awk '{print $2}')"
}