Created
April 13, 2022 17:12
-
-
Save jesseleite/3331f3eb6668c94dc97877419db2c9b8 to your computer and use it in GitHub Desktop.
Minimal nvim config for nvim-treesitter testing
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
vim.cmd [[set runtimepath=$VIMRUNTIME]] | |
vim.cmd [[set packpath=/tmp/nvim/site]] | |
local package_root = '/tmp/nvim/site/pack' | |
local install_path = package_root .. '/packer/start/packer.nvim' | |
local function load_plugins() | |
require('packer').startup { | |
{ | |
'wbthomason/packer.nvim', | |
{ | |
'nvim-treesitter/nvim-treesitter', | |
}, | |
}, | |
config = { | |
package_root = package_root, | |
compile_path = install_path .. '/plugin/packer_compiled.lua', | |
display = { non_interactive = true }, | |
}, | |
} | |
end | |
_G.load_config = function() | |
require'nvim-treesitter.configs'.setup { | |
ensure_installed = { 'lua', 'c', 'rust' }, | |
} | |
end | |
if vim.fn.isdirectory(install_path) == 0 then | |
print("Installing Treesitter and dependencies.") | |
vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path } | |
end | |
load_plugins() | |
require('packer').sync() | |
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment