-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Improve nvim & treesitter setup in CI, remove format-queries script
- Loading branch information
Showing
4 changed files
with
73 additions
and
466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
-- Bootstrap lazy.nvim | ||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" | ||
if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||
local lazyrepo = "https://github.com/folke/lazy.nvim.git" | ||
local out = vim.fn.system { "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath } | ||
if vim.v.shell_error ~= 0 then | ||
vim.api.nvim_echo({ | ||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }, | ||
{ out, "WarningMsg" }, | ||
{ "\nPress any key to exit..." }, | ||
}, true, {}) | ||
vim.fn.getchar() | ||
os.exit(1) | ||
end | ||
end | ||
vim.opt.rtp:prepend(lazypath) | ||
|
||
-- Make sure to setup `mapleader` and `maplocalleader` before | ||
-- loading lazy.nvim so that mappings are correct. | ||
-- This is also a good place to setup other settings (vim.opt) | ||
vim.g.mapleader = " " | ||
vim.g.maplocalleader = "\\" | ||
|
||
-- Setup lazy.nvim | ||
require("lazy").setup { | ||
spec = { | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
build = ":TSUpdate", | ||
config = function() | ||
local configs = require "nvim-treesitter.configs" | ||
|
||
configs.setup { | ||
ensure_installed = { "query" }, | ||
sync_install = false, | ||
highlight = { enable = true }, | ||
indent = { enable = true }, | ||
} | ||
end, | ||
}, | ||
}, | ||
-- Configure any other settings here. See the documentation for more details. | ||
-- colorscheme that will be used when installing plugins. | ||
install = { colorscheme = { "habamax" } }, | ||
-- automatically check for plugin updates | ||
checker = { enabled = true }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
os=$(uname -s) | ||
if [[ $os == Linux ]]; then | ||
wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-linux64.tar.gz | ||
tar -zxf nvim-linux64.tar.gz | ||
sudo ln -s "$PWD"/nvim-linux64/bin/nvim /usr/local/bin | ||
rm -rf "$PWD"/nvim-linux64/lib/nvim/parser | ||
mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start | ||
ln -s "$PWD" ~/.local/share/nvim/site/pack/nvim-treesitter/start | ||
elif [[ $os == Darwin ]]; then | ||
RELEASE_NAME="nvim-macos-$(uname -m)" | ||
curl -L "https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/$RELEASE_NAME.tar.gz" | tar -xz | ||
sudo ln -s "$PWD/$RELEASE_NAME/bin/nvim" /usr/local/bin | ||
rm -rf "$PWD/$RELEASE_NAME/lib/nvim/parser" | ||
mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start | ||
ln -s "$PWD" ~/.local/share/nvim/site/pack/nvim-treesitter/start | ||
else | ||
curl -L https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-win64.zip -o nvim-win64.zip | ||
unzip nvim-win64 | ||
mkdir -p ~/AppData/Local/nvim/pack/nvim-treesitter/start | ||
mkdir -p ~/AppData/Local/nvim-data | ||
cp -r "$PWD" ~/AppData/Local/nvim/pack/nvim-treesitter/start | ||
fi |
Oops, something went wrong.