-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.commonrc
114 lines (93 loc) · 1.88 KB
/
.commonrc
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
105
106
107
108
109
110
111
112
113
114
# Exports
export TERM="xterm-256color"
export EDITOR=vim
export VISUAL=vim
# Path
if [ -d "$HOME/.bin" ]
then
PATH="$HOME/.bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ]
then
PATH="$HOME/.local/bin:$PATH"
fi
if [ -d "$HOME/Applications" ]
then
PATH="$HOME/Applications:$PATH"
fi
# Pypy
PATH=$PATH:/opt/pypy3.9-v7.3.10-macos_arm64/bin
# Gcloud
PATH=$PATH:/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin
# Rust
if [ -f "$HOME/.cargo/env" ]
then
source "$HOME/.cargo/env"
fi
# Plain aliases
alias cl="clear"
alias z="zoxide"
alias g="git"
alias y="yarn"
alias pn="pnpm"
# Utilities
alias dot='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'
alias tmx='tmux attach || tmux new -s main'
alias dsa='docker stop $(docker ps -q)'
alias fs='fortune | cowsay | lolcat'
alias nnn='nnn -dH'
alias ll='ls -la'
function gremote()
{
open "$(git remote get-url origin)"
}
exists ()
{
command -v "$1" >/dev/null 2>&1
}
# Better ls
if exists eza
then
alias ls='eza --group-directories-first --icons'
alias ll='ls -lha --git'
fi
# Better file viewer
if exists bat
then
export BAT_THEME="ansi"
alias cat='bat'
fi
# Better disk space analyzer
if exists ncdu
then
alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules"
fi
# Better ping
if exists prettytyping
then
alias ping='prettyping --nolegend'
fi
# Better vim
if exists nvim
then
alias v="nvim"
export EDITOR=nvim
export VISUAL=nvim
else
alias v="vim"
fi
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# bun completions
[ -s "/Users/nielsg/.bun/_bun" ] && source "/Users/nielsg/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# Add default flags
alias df='df -h'
# Zoxide
if exists zoxide
then
eval "$(zoxide init zsh)"
fi