-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-neovim.zsh
42 lines (33 loc) · 952 Bytes
/
setup-neovim.zsh
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
header "SETUP NEOVIM"
# Build prerequisites
sudo apt-get install ninja-build gettext cmake unzip curl build-essential python3-pip
sudo python3.11 -m pip install cmake
# Neovim support packages
sudo apt-get -y install \
xclip \
;
sudo python3.11 -m pip install --upgrade pynvim neovim-remote
if command -v npm >/dev/null && ! npm list -g --depth 0 neovim >/dev/null; then
npm install -g neovim
fi
# Clone and build
old_dir=$(pwd)
mkdir -p $HOME/src
if [ ! -d $HOME/src/neovim ]; then
git clone https://github.com/neovim/neovim.git $HOME/src/neovim
fi
cd $HOME/src/neovim
git fetch --prune --tags --force
CUR_TAG=$(git name-rev --tags --name-only HEAD)
if [ "$CUR_TAG" != "stable" ]; then
echo "$CUR_TAG != 'stable' - updating"
git checkout stable
git clean -dfx
make CMAKE_BUILD_TYPE=RelWithDebInfo
cd build
cpack -G DEB
sudo dpkg -i nvim-linux64.deb
# Setup
nvim --headless "+Lazy! sync" +qa
fi
cd "$old_dir"