summarylogtreecommitdiffstats
path: root/init-lvim.sh
blob: 87a70120dadaa084f803b507927c56a53aa67de3 (plain)
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
#!/bin/bash
mkdir -p ~/.config/lvim
ln -s /usr/share/doc/lunarvim/config.example-no-ts.lua ~/.config/lvim/config.lua
mkdir -p ~/.local/share/lunarvim
ln -s /usr/share/lunarvim ~/.local/share/lunarvim/lvim

echo "Installing dependencies of NodeJS & Rust..."
npm install -g neovim
npm install -g tree-sitter-cli
yarn global add neovim
yarn global add tree-sitter-cli
cargo install fd-find
cargo install ripgrep

echo "Installing Packer..."
git clone https://github.com/wbthomason/packer.nvim ~/.local/share/lunarvim/site/pack/packer/start/packer.nvim

echo "PackerInstall..."
lvim --headless +'autocmd User PackerComplete sleep 100m | qall' +PackerInstall

echo "PackerSync..."
lvim --headless +'autocmd User PackerComplete sleep 100m | qall' +PackerSync
rm ~/.config/lvim/config.lua
cp /usr/share/doc/lunarvim/config.example.lua ~/.config/lvim/config.lua

echo "Installing treesitter parsers.."
ln -s /usr/share/lunarvim/prebuild/nvim-treesitter/parser/* \
  ~/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter/parser/
ln -s /usr/share/lunarvim/prebuild/nvim-treesitter/parser-info/* \
  ~/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter/parser-info/

echo "Generate the new ftplugin template files.."
lvim --headless +LvimUpdate +q

echo
echo "lunarvim runtime is inited for $(whoami)"
echo "clean up by:"
echo "    rm -rf ~/.config/lvim ~/.local/share/lunarvim"