add treesitter hopefully
This commit is contained in:
parent
9c2b8d00aa
commit
408555ba20
1 changed files with 34 additions and 1 deletions
|
|
@ -6,13 +6,46 @@ return {
|
|||
load("nvim-neotest/nvim-nio")
|
||||
load("pysan3/pathlib.nvim")
|
||||
load("nvim-neorg/lua-utils.nvim")
|
||||
load("nvim-neorg/tree-sitter-norg")
|
||||
-- parser {{{
|
||||
local data = vim.fn.stdpath("data")
|
||||
local src = data .. "/site/pack/core/opt/tree-sitter-norg"
|
||||
local src_meta = data .. "/site/pack/core/opt/tree-sitter-norg-meta"
|
||||
local parser_dir = data .. "/site/parser"
|
||||
local out = parser_dir .. "/norg.so"
|
||||
local out_meta = parser_dir .. "/norg_meta.so"
|
||||
|
||||
|
||||
if not vim.uv.fs_stat(out) and vim.uv.fs_stat(src) then
|
||||
-- not already built, and present
|
||||
vim.fn.mkdir(parser_dir, "p")
|
||||
local result = vim.system({ "nix", "build" }, { cwd = src }):wait()
|
||||
if result.code == 0 then
|
||||
vim.system({ "cp", "result/lib/lua/5.1/parser/norg.so", out }, { cwd = src }):wait()
|
||||
else
|
||||
vim.notify("failed to run nix build for norg treesitter, got result " .. tostring(result),
|
||||
vim.log.levels.ERROR)
|
||||
end
|
||||
result = vim.system({ "nix", "build" }, { cwd = src_meta }):wait()
|
||||
if result.code == 0 then
|
||||
vim.system({ "cp", "result/parser", out_meta }, { cwd = src_meta }):wait()
|
||||
else
|
||||
vim.notify("failed to run nix build for norg_meta treesitter, got result " .. tostring(result),
|
||||
vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
|
||||
-- }}}
|
||||
|
||||
load("nvim-neorg/neorg")
|
||||
require("neorg").setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.concealer"] = {},
|
||||
-- ["core.completion"] = { config = { engine = "nvim-cmp" } },
|
||||
-- ["core.integrations.treesitter"] = {},
|
||||
["core.integrations.treesitter"] = {
|
||||
config = { configure_parsers = false },
|
||||
},
|
||||
["core.clipboard.code-blocks"] = {},
|
||||
["core.esupports.indent"] = {},
|
||||
["core.dirman"] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue