Compare commits
8 commits
109b6dd717
...
327651d68d
| Author | SHA1 | Date | |
|---|---|---|---|
| 327651d68d | |||
| 63d295a739 | |||
| 408555ba20 | |||
| 9c2b8d00aa | |||
| 35718a7b1c | |||
| c9e686a19d | |||
| dac9d33960 | |||
| add1882062 |
4 changed files with 43 additions and 25 deletions
2
init.lua
2
init.lua
|
|
@ -13,7 +13,7 @@ local plugins = {
|
|||
"treesitter",
|
||||
"nvim-lint",
|
||||
|
||||
-- "neorg",
|
||||
"neorg",
|
||||
|
||||
"nightfox",
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ return {
|
|||
require("lazydev").setup({})
|
||||
|
||||
load("rafamadriz/friendly-snippets")
|
||||
load("saghen/blink.lib")
|
||||
load("saghen/blink.cmp")
|
||||
|
||||
|
||||
---@module "blink.cmp"
|
||||
require("blink.cmp").setup({
|
||||
keymap = { preset = "super-tab" },
|
||||
|
|
@ -47,22 +49,7 @@ return {
|
|||
end,
|
||||
onUpdate = function()
|
||||
vim.notify("Building blink.cmp", vim.log.levels.INFO)
|
||||
local cmd
|
||||
if vim.fn.executable("nix") == 1 then
|
||||
cmd = { "nix", "run", ".#build-plugin" }
|
||||
elseif vim.fn.executable("cargo") == 1 then
|
||||
cmd = { "cargo", "build", "--release" }
|
||||
else
|
||||
print("either cargo or nix is needed to build blink.cmp fzf")
|
||||
return
|
||||
end
|
||||
local obj = vim.system(cmd, { cwd = vim.pack.get({ "blink.cmp" })[1].path })
|
||||
:wait()
|
||||
if obj.code == 0 then
|
||||
vim.notify("Building blink.cmp done", vim.log.levels.INFO)
|
||||
else
|
||||
vim.notify("Building blink.cmp failed", vim.log.levels.ERROR)
|
||||
end
|
||||
require('blink.cmp').build():pwait()
|
||||
end,
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,20 +6,50 @@ return {
|
|||
load("nvim-neotest/nvim-nio")
|
||||
load("pysan3/pathlib.nvim")
|
||||
load("nvim-neorg/lua-utils.nvim")
|
||||
load("juniorsundar/neorg-extras")
|
||||
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"
|
||||
vim.fn.mkdir(parser_dir, "p")
|
||||
|
||||
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 src present
|
||||
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
|
||||
end
|
||||
if not vim.uv.fs_stat(out_meta) and vim.uv.fs_stat(src_meta) then
|
||||
-- not already built, and src present
|
||||
local 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 = {
|
||||
["external.many-mans"] = {
|
||||
config = {
|
||||
metadata_fold = true, -- If want @data property ... @end to fold
|
||||
code_fold = true, -- If want @code ... @end to fold
|
||||
},
|
||||
},
|
||||
["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"] = {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ return {
|
|||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = true,
|
||||
virtual_lines = { current_line = true },
|
||||
})
|
||||
|
||||
require("lint").linters_by_ft = require("mason-bridge").get_linters()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue