-
Notifications
You must be signed in to change notification settings - Fork 3
/
nvim_setup.sh
executable file
·75 lines (61 loc) · 1.46 KB
/
nvim_setup.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
# Maintainer: Faris Chugthai
log() {
local yellow="\e[0;33m"
local magenta="\e[0;35m"
local red="\e[0;31m"
local reset="\e[0;0m"
printf "$magenta>$red>$yellow>$reset %s\n" "$*" 1>&2
}
setup_plug() {
log "Installing vim-plug"
sleep 3
if [[ -z "$HOME/.local/share/nvim/site/autoload/plug.vim" ]]; then
curl -fLo "$HOME/.local/share/nvim/autoload/plug.vim" --create-dirs \
"https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
fi
nvim -c"PlugInstall!" -c"PlugUpgrade" -c "UpdateRemotePlugins" -c"qa" &
}
update_pkgs() {
local update
if [[ -n $ANDROID_ROOT ]]; then
update="pkg update"
else
update="sudo apt update"
fi
log "Updating packages"
$update;
}
install_nvim() {
local install
if [[ -n $ANDROID_ROOT ]]; then
install="pkg install neovim"
else
install="sudo apt install neovim nvim-qt"
fi
log "Installing neovim"
$install;
}
setup_pynvim() {
if [[ -n "$VIRTUAL_ENV" ]]; then
python3 -m pip install -U pynvim
else
python3 -m pip install -U --user pynvim
fi
log "Done installing pynvim!"
log "We're all set up!"
}
notify() {
if [[ -z "$(command -v termux-notification)" ]]; then
return
fi
if [[ -n "$1" ]]; then
echo "$1" | termux-notification
fi
}
update_pkgs
install_nvim
setup_plug
sleep 30
setup_pynvim
$notify "Pynvim done updating."