-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zsh_aliases
104 lines (86 loc) · 4.27 KB
/
dot_zsh_aliases
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
# -*-mode:zsh-*- vim:ft=zsh
#
# ~/.zsh_aliases
# =============================================================================
# Shell aliases sourced by `~/.zshrc`.
#
# OSTYPE values used:
# - darwin: macOS
# - cygwin: Cygwin POSIX-compatible environment for Windows
# - mingw: MinGW Minimalist GNU for Windows
# - msys: MinGW Lightweight shell and GNU utilities for Windows
# Redefine standard commands to improve their behavior
# -----------------------------------------------------------------------------
#
# TODO: use oh-my-zshell alias functions
#
# -- Local navigation --------------------------------------------------
if (( ${+commands[eza]} )); then
__alias ll "eza --time modified --all --binary --git --header --long --color=always "
__alias lt "eza --long --tree --level=3 "
fi
# -- Git --------------------------------------------------
__remove_alias grmci
function grmci () {
# TODO: Function needs to be reworked doesn't really do what I want
# Remove cached files that have been ignored by git locally or globally.
git ls-files --others | xargs -n1 -I '{}' git rm --cached --quiet --ignore-unmatch -- ./{}
}
# __alias gignored "git ls-files -v $(git rev-parse --show-toplevel) | (grep '^[[:lower:]]' || echo 'None ignored.') && echo '\nIgnore changes with: git update-index --assume-unchanged <file> \nor track again with: git update-index --no-assume-unchanged <file>'"
#__remove_alias gcp # Use gnu cp command as default for `gcp`. Gnu cp is installed with `brew install coreutils`
__alias gst "git status -b"
__alias gsta " git log --oneline \
--pretty='%Cred%h%Creset -%C(auto)%d%Creset %<(50,trunc)%s %Cgreen(%cr) %C(bold blue)<%an>%Creset' -5; \
git status -b --ignored"
__alias gcm "git commit -a -S -m"
__alias glog "git log --oneline --decorate --graph --show-signature"
__alias gloga "git log --oneline --decorate --graph --show-signature --all"
__alias gwch "git whatchanged -p --abbrev-commit --pretty=medium"
__alias gcd "git checkout development"
__alias glos "git log --oneline --pretty='%Cred%h%Creset -%C(auto)%d%Creset %<(50,trunc)%s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --no-merges"
# -- miscellaneous --------------------------------------------------
alias rg="$(brew --prefix rg)/bin/rg --smart-case"
alias batgrep="batgrep --smart-case"
alias ranger="TERM=xterm-256color $(brew --prefix ranger)/bin/ranger --choosedir=$HOME/.rangerdir"
# https://github.com/antonmedv/fx
alias fx="FX_LANG=python3 NODE_PATH=`npm root -g` fx"
# https://github.com/antonmedv/eat
alias eat="NODE_PATH=`npm root -g` eat"
alias fd="fd --unrestricted --ignore-case"
# Reloads the configuration.
if [ -n "$ZSH_VERSION" ]; then
__alias resource 'source $HOME/.zshrc'
else
__alias resource 'source $HOME/.bash_profile'
fi
__alias note 'cd $MARKDOWN_NOTES && lvim .'
# __alias gradle "TERM=xterm ./gradlew"
#__alias lldb "PATH=/usr/bin:$PATH lldb"
# alias pandoc="/usr/local/opt/pandoc/bin/pandoc"
__alias chezmoidelta "chezmoi source pull -- --rebase && chezmoi diff | delta"
__alias ipython "EDITOR=zed ipython"
__alias gloudtoken "gcloud auth login --brief && gcloud auth print-identity-token"
__alias trash_pycharm_remote_resources "trash -v ~/Library/Caches/JetBrains/PyCharm2021.2/remote_sources ~/Library/Caches/JetBrains/PyCharm2021.2/tmp"
# __alias tg "terragrunt"
__alias tmuxm "tmux new-session -A -s main"
# __alias clear_sbt_cache "trash ~/.ivy2/cache ~/.m2/repository"
# __alias sbt__ "sbt --sbt-version 1.8.0 -Dsbt.semanticdb=true"
alias sbtn="SCALACTIC_FILL_FILE_PATHNAMES=yes sbtn --verbose"
__alias tmux-save-pane 'tmux capture-pane -pS -'
# -- configuration paths ------------------------------------------------------
# Navigates to Chezmoi's local repo.
if command -v chezmoi > /dev/null; then
if [[ "$OSTYPE" =~ ^(cygwin|mingw|msys) ]]; then
# shellcheck disable=SC2046,SC2139
__alias chezmoiconf "cd $(chezmoi source-path | tr '\\/' '/' | tr -d ':' | awk '{print "/"$1}')"
else
__alias chezmoiconf 'cd $(chezmoi source-path)'
fi
else
__alias chezmoiconf 'cd $HOME/.local/share/chezmoi'
fi
# Because I keep forgetting the name of this command
alias macos_info=neofetch
alias poetry-run="poetry run python -m"
alias ghe='GH_HOST=code.corp.creditkarma.com gh'
alias ghorg="git remote get-url origin | cut -d/ -f 4"