-
Notifications
You must be signed in to change notification settings - Fork 3
/
.bash_vendor
167 lines (146 loc) · 10.9 KB
/
.bash_vendor
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/bin/bash
# shellcheck disable=SC1090,SC2086,SC1091
# ╔═════════════════════════════════════════════════════════════════╗
# ║ BASH_VENDORS ║
# ╚═════════════════════════════════════════════════════════════════╝
# https://github.com/cheat/cheat
export CHEAT_USE_FZF=true
# ╔═════════════════════════════════════════════════════════════════╗
# ║ Java JDK ║
# ╚═════════════════════════════════════════════════════════════════╝
# [Pkg] default-jdk default-jre
# [Locate] $ readlink -f `which javac` | sed "s:/bin/javac::"
# [Notes] Java is always a symbolic link using update-alternatives
if [ -L /usr/bin/java ]; then
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java
export PATH=$PATH:$JAVA_HOME/bin
fi
# ╔═════════════════════════════════════════════════════════════════╗
# ║ Dotnet JDK ║
# ╚═════════════════════════════════════════════════════════════════╝
# [Pkg] dotnet-install.sh
# [Locate] $ readlink -f `which javac` | sed "s:/bin/javac::"
# [Notes] wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
# chmod +x ./dotnet-install.sh && ./dotnet-install.sh
# (See ~/.dotnet folder)
if [ -d $HOME/.dotnet ]; then
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT/tools
alias dotnet=$DOTNET_ROOT/dotnet
fi
# ╔═════════════════════════════════════════════════════════════════╗
# ║ Rust Language ║
# ╚═════════════════════════════════════════════════════════════════╝
# [Pkg] Rust
# [Install] $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
[[ -d $XDG_DATA_HOME/cargo/bin ]] && export PATH=$PATH:$XDG_DATA_HOME/cargo/bin
# ╔═════════════════════════════════════════════════════════════════╗
# ║ Node / NPM / Yarn / PNPM ║
# ║ (!) Place ~/.yarn before ~/.npm so is takes precidence. ║
# ╚═════════════════════════════════════════════════════════════════╝
# [Pkg] Yarn (NPM alternative)
# [Install] $ npm i -g yarn
# ───────────────────────────────────────────────────────────────────
[[ -d $HOME/.yarn/bin ]] && export PATH=$PATH:$HOME/.yarn/bin
alias yarn='yarn --use-yarnrc "$XDG_CONFIG_HOME/yarn/config"'
# pnpm (Phantom NPM) (NPM Alternative)
# ───────────────────────────────────────────────────────────────────
# [Pkg] https:/pnpm.io
# [Install] curl -fsSL https://get.pnpm.io/install.sh | sh -
# [Use] $ pnpm -h
if [ -d $HOME/.local/share/pnpm ]; then
export PNPM_HOME="$HOME/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"
alias pn=pnpm
fi
# ╔═════════════════════════════════════════════════════════════════╗
# ║ GoLang ║
# ╚═════════════════════════════════════════════════════════════════╝
# [Pkg] https://go.dev/
# [Install] Download @ https://go.dev/dl/
# [Use] $ go -h
if [ -d /usr/local/go ]; then
# Do GO development in $GOPATH
export GOPATH=$XDG_DATA_HOME/go
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$GOPATH/bin
fi
# VSCode Devcontainer CLI
if [ -d $XDG_CONFIG_HOME/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin ]; then
PATH=$PATH:$XDG_CONFIG_HOME/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin
fi
# ╔═════════════════════════════════════════════════════════════════╗
# ║ Python / PyEnv ║
# ╚═════════════════════════════════════════════════════════════════╝
# Stop generating bytecode files
export PYTHONDONTWRITEBYTECODE=1
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
# ╔═════════════════════════════════════════════════════════════════╗
# ║ Composer / PHP ║
# ╚═════════════════════════════════════════════════════════════════╝
[ -d $XDG_CONFIG_HOME/composer/vendor/bin ] && PATH=$PATH:$XDG_CONFIG_HOME/composer/vendor/bin
# Pipx is for installing pythong commands (not packages)
# ───────────────────────────────────────────────────────────────────
# [Pkg] pip install pipx
if [ -x $HOME/.local/bin/pipx ]; then
eval "$(register-python-argcomplete pipx)"
fi
# ╔═════════════════════════════════════════════════════════════════╗
# ║ Bash Helpers ║
# ╚═════════════════════════════════════════════════════════════════╝
# ───────────────────────────────────────────────────────────────────
# GRC (Bash Color Highlights)
# ───────────────────────────────────────────────────────────────────
# [Pkg] apt install grc
# [Toggle] sudo sed -i 's/^GRC_ALIASES.*/GRC_ALIASES=true/' /etc/default/grc
export GRC_ALIASES=true
if [ -f /etc/profile.d/grc.sh ]; then
source /etc/profile.d/grc.sh
fi
# ───────────────────────────────────────────────────────────────────
# Better concat (cat) function with colors
# ───────────────────────────────────────────────────────────────────
# [Pkg] https://github.com/sharkdp/bat
# [Use] $ batcat -h
if command -v batcat &>/dev/null; then
# --plain for no line numbers
# --paging never (because I can't copy/paste so nicely)
alias cat='batcat --theme="Monokai Extended Origin" --plain --paging=never'
fi
# ───────────────────────────────────────────────────────────────────
# Z Directory Jumper - Easily Finds Recent Paths
# ───────────────────────────────────────────────────────────────────
# [Pkg] https://github.com/skywind3000/z.lua
# [Use] $ z serv <ENTER> ; (Will go to recent path of /server/)
if [ -f $HOME/.z.lua/z.lua ]; then
eval "$(lua $HOME/.z.lua/z.lua --init bash enhanced once)"
fi
# ───────────────────────────────────────────────────────────────────
# FZF Fuzzy Finder (Very Powerful Tool)
# ───────────────────────────────────────────────────────────────────
# [Pkg] https://github.com/junegunn/fzf
# apt install fzf
# [Use] $ fzf
# $ cat anyfile | fzf
# <ALT> + C Fuzzy Directory Jump
# <CTRL> + R History Fuzzy Search
if [ -x /usr/bin/fzf ]; then
return 0 # Check .profile -- issue with keybinding in wrong path
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border=rounded --tabstop=4 --color=dark,info:bright-green,pointer:green,hl:bright-green'
export FZF_DEFAULT_COMMAND="fd . $HOME"
export FZF_ALT_C_COMMAND="fd -t d . $HOME"
#fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf "$@" --preview 'tree -C {} | head -200' ;;
*) fzf "$@" ;;
esac
}
fi
[ -x /usr/bin/fdfind ] && alias fd='fdfind'
# ───────────────────────────────────────────────────────────────────
# DirEnv
# ───────────────────────────────────────────────────────────────────
[ -x /usr/bin/direnv ] && eval "$(direnv hook bash)"