Skip to content

Instantly share code, notes, and snippets.

@gwww
Created March 22, 2021 23:59
Show Gist options
  • Save gwww/385c686aabb3efa317fd728c57967686 to your computer and use it in GitHub Desktop.
Save gwww/385c686aabb3efa317fd728c57967686 to your computer and use it in GitHub Desktop.
Test init.lua to test tree-sitter
-------------------- HELPERS -------------------------------
local api, cmd, fn, g = vim.api, vim.cmd, vim.fn, vim.g
local execute = vim.api.nvim_command
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
local function map(mode, lhs, rhs, opts)
local options = {noremap = true}
if opts then options = vim.tbl_extend('force', options, opts) end
api.nvim_set_keymap(mode, lhs, rhs, options)
end
local function opt(scope, key, value)
scopes[scope][key] = value
if scope ~= 'o' then scopes['o'][key] = value end
end
-------------------- PLUGINS -------------------------------
-- Auto install paq-nvim if it doesn't exist
local install_path = fn.stdpath('data')..'/site/pack/paqs/opt/paq-nvim'
if fn.empty(fn.glob(install_path)) > 0 then
execute('!git clone https://github.com/savq/paq-nvim.git ' .. install_path)
end
cmd 'packadd paq-nvim'
local paq = require('paq-nvim').paq
paq {'savq/paq-nvim', opt = true}
paq {'nvim-treesitter/nvim-treesitter'}
-------------------- TREE-SITTER ---------------------------
local ts = require 'nvim-treesitter.configs'
ts.setup {ensure_installed = 'maintained', highlight = {enable = true}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment