forked from musq/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.sh
executable file
·59 lines (39 loc) · 1.32 KB
/
helpers.sh
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
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")" \
&& . "../utils.sh"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
install_neovim_python() {
local -r path="$HOME/.local/share/nvim/pynvim"
# shellcheck disable=SC2230
local pythonPath="$(which python3)"
if [ -x "/usr/bin/python3" ]; then
pythonPath="/usr/bin/python3"
elif [ -x "/usr/local/bin/python3" ]; then
pythonPath="/usr/local/bin/python3"
fi
execute \
"$pythonPath -m venv $path \
&& $path/bin/pip install neovim" \
"Neovim helper"
}
install_tmux_plugin_manager() {
local -r path="$HOME/.cache/tmux/plugins/tpm"
local -r tmuxConfig="$HOME/.config/tmux/tmux.conf"
execute \
"rm -rf $path \
&& mkdir -p $path \
&& git clone https://github.com/tmux-plugins/tpm $path" \
"Tmux Plugin Manager"
execute \
"tmux -f $tmuxConfig new -d -s tpm \
&& tmux send-keys -t tpm.1 \". $path/bindings/install_plugins && exit\" ENTER" \
"Tmux plugins"
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
main() {
print_in_purple "\n Helpers\n\n"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
install_neovim_python
install_tmux_plugin_manager
}
main