Fix treesitter setup and Mason
Lua package Apply the Neovim config fixes for current plugin APIs:\n- replace deprecated nvim-treesitter install call with configs.setup
This commit is contained in:
parent
e79572c9e6
commit
726ce0c964
8
init.lua
8
init.lua
|
|
@ -614,7 +614,7 @@ require('lazy').setup({
|
||||||
-- You can press `g?` for help in this menu.
|
-- You can press `g?` for help in this menu.
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
vim.list_extend(ensure_installed, {
|
vim.list_extend(ensure_installed, {
|
||||||
'lua_ls', -- Lua Language server
|
'lua-language-server', -- Mason package for lua_ls
|
||||||
'stylua', -- Used to format Lua code
|
'stylua', -- Used to format Lua code
|
||||||
-- You can add other tools here that you want Mason to install
|
-- You can add other tools here that you want Mason to install
|
||||||
})
|
})
|
||||||
|
|
@ -853,7 +853,11 @@ require('lazy').setup({
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
config = function()
|
config = function()
|
||||||
local filetypes = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
|
local filetypes = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
|
||||||
require('nvim-treesitter').install(filetypes)
|
require('nvim-treesitter.configs').setup {
|
||||||
|
ensure_installed = filetypes,
|
||||||
|
auto_install = true,
|
||||||
|
highlight = { enable = true },
|
||||||
|
}
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = filetypes,
|
pattern = filetypes,
|
||||||
callback = function() vim.treesitter.start() end,
|
callback = function() vim.treesitter.start() end,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue