Fix neorg dependency and completions

This commit is contained in:
Evie Litherland-Smith 2023-06-10 08:29:21 +01:00
parent 97dd1f8802
commit b52d724e88
3 changed files with 6 additions and 17 deletions

View file

@ -36,19 +36,16 @@ local config = function()
end end
end, { "i", "s" }), end, { "i", "s" }),
}, },
sources = { { name = "nvim_lsp" }, { name = "luasnip" } }, sources = { { name = "nvim_lsp" }, { name = "luasnip" }, { name = "neorg" } },
} }
-- Set configuration for specific filetype.
cmp.setup.filetype("norg", { sources = { { name = "neorg" } } })
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end end
return { return {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
cond = not vim.g.vscode, cond = not vim.g.vscode,
event = { "InsertEnter", "CmdlineEnter" }, event = "InsertEnter",
dependencies = { dependencies = {
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"windwp/nvim-autopairs", "windwp/nvim-autopairs",

View file

@ -1,16 +1,12 @@
return { return {
"nvim-neorg/neorg", "nvim-neorg/neorg",
cond = function() return vim.fn.executable("nix") == 1 and not vim.g.vscode end, cond = function() return vim.fn.executable "nix" == 1 and not vim.g.vscode end,
build = ":Neorg sync-parsers", build = ":Neorg sync-parsers",
event = { "FileType norg" }, ft = "norg",
cmd = "Neorg", cmd = "Neorg",
lazy = true, lazy = true,
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter" },
init = function() init = function()
vim.api.nvim_create_autocmd({ "BufNewFile", "BufReadPost" }, {
pattern = { "*.norg" },
command = "set filetype=norg",
})
vim.api.nvim_create_autocmd({ "BufWritePre" }, { vim.api.nvim_create_autocmd({ "BufWritePre" }, {
pattern = { "*.norg" }, pattern = { "*.norg" },
command = "Neorg update-metadata", command = "Neorg update-metadata",
@ -22,12 +18,8 @@ return {
["core.concealer"] = { config = { icon_preset = "diamond" } }, ["core.concealer"] = { config = { icon_preset = "diamond" } },
["core.dirman"] = { config = { workspaces = { personal = "~/notes/personal", work = "~/notes/work" } } }, ["core.dirman"] = { config = { workspaces = { personal = "~/notes/personal", work = "~/notes/work" } } },
["core.completion"] = { config = { engine = "nvim-cmp" } }, ["core.completion"] = { config = { engine = "nvim-cmp" } },
["core.export"] = {},
["core.journal"] = {}, ["core.journal"] = {},
["core.presenter"] = { config = { zen_mode = "zen-mode" } }, ["core.presenter"] = { config = { zen_mode = "zen-mode" } },
["core.summary"] = { config = { strategy = "metadata" } },
-- ["core.ui.calendar"] = {},
-- ["core.integrations.telescope"] = {},
}, },
}, },
} }

View file

@ -4,7 +4,7 @@ return {
version = false, version = false,
build = ":TSUpdate", build = ":TSUpdate",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
dependencies = { "nvim-treesitter/nvim-treesitter-refactor", "nvim-neorg/neorg" }, dependencies = "nvim-treesitter/nvim-treesitter-refactor",
config = function(_, opts) config = function(_, opts)
if type(opts.ensure_installed) == "table" then if type(opts.ensure_installed) == "table" then
-- @type table<string, boolean> -- @type table<string, boolean>