treesitter
This commit is contained in:
@@ -12,6 +12,7 @@ local function flatten_to_array(t)
|
|||||||
_flatten(t)
|
_flatten(t)
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
|
||||||
local capabilities = vim.tbl_deep_extend(
|
local capabilities = vim.tbl_deep_extend(
|
||||||
"force",
|
"force",
|
||||||
{},
|
{},
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
local treesitter = require'nvim-treesitter'
|
local treesitter = require "nvim-treesitter"
|
||||||
|
|
||||||
treesitter.setup {}
|
treesitter.setup {}
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local has_parser = pcall(vim.treesitter.get_parser, args.buf)
|
local has_parser = pcall(vim.treesitter.get_parser, args.buf)
|
||||||
|
|
||||||
@@ -11,6 +11,8 @@ vim.api.nvim_create_autocmd('FileType', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
vim.treesitter.start()
|
vim.treesitter.start()
|
||||||
|
if vim.treesitter.get_parser(args.buf):lang() ~= "python" then
|
||||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user