Skip to content

Instantly share code, notes, and snippets.

@jesseleite
Created April 13, 2022 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesseleite/3331f3eb6668c94dc97877419db2c9b8 to your computer and use it in GitHub Desktop.
Save jesseleite/3331f3eb6668c94dc97877419db2c9b8 to your computer and use it in GitHub Desktop.
Minimal nvim config for nvim-treesitter testing
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