updated for working comments and fixing errors
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Read(//Users/shelbybark/.local/share/nvim/lazy/nvim-treesitter/**)",
|
||||||
|
"Read(//Users/shelbybark/.local/share/nvim/**)",
|
||||||
|
"Bash(nvim --headless -c \"lua print\\(vim.fn.stdpath\\('data'\\)\\)\" -c \"q\")",
|
||||||
|
"Bash(nvim --headless -c \"lua print\\(vim.api.nvim_get_runtime_file\\('parser', true\\)[1] or 'none'\\)\" -c \"q\")",
|
||||||
|
"Bash(nvim --headless -c \"lua io.write\\(vim.fn.stdpath\\('data'\\) .. '\\\\n'\\)\" -c \"q\")"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,19 +11,13 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
dependencies = {
|
|
||||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
|
||||||
},
|
|
||||||
config = function()
|
config = function()
|
||||||
-- import comment plugin safely
|
require("Comment").setup({
|
||||||
local comment = require("Comment")
|
-- ft.calculate uses a LanguageTree API that changed in Neovim 0.12 and crashes.
|
||||||
|
-- This hook looks up the commentstring directly, bypassing the broken treesitter path.
|
||||||
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
|
pre_hook = function(ctx)
|
||||||
|
return require("Comment.ft").get(vim.bo.filetype, ctx.ctype) or vim.bo.commentstring
|
||||||
-- enable comment
|
end,
|
||||||
comment.setup({
|
|
||||||
-- for commenting tsx, jsx, svelte, html files
|
|
||||||
pre_hook = ts_context_commentstring.create_pre_hook(),
|
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user