nvim/lua/plugins/nvim_neorg.lua

47 lines
2 KiB
Lua
Raw Normal View History

return {
"nvim-neorg/neorg",
cond = function() return vim.fn.executable "nix" == 1 end,
build = ":Neorg sync-parsers",
2023-06-10 08:29:21 +01:00
ft = "norg",
cmd = "Neorg",
lazy = true,
dependencies = { "plenary.nvim", "nvim-treesitter", "nvim-cmp", "nabla.nvim" },
init = function()
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
pattern = { "*.norg" },
command = "Neorg update-metadata",
})
2023-06-30 13:23:41 +01:00
vim.api.nvim_create_autocmd({ "BufReadPre", "BufNewFile" }, {
pattern = { "*.norg" },
command = "setlocal spell spelllang=en_gb",
})
vim.api.nvim_create_autocmd({ "BufReadPre", "BufNewFile" }, {
pattern = { "*.norg" },
command = "setlocal textwidth=79",
})
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = { "*.norg" },
command = "lua require('nabla').enable_virt()",
})
vim.keymap.set("n", "<leader>wp", "<cmd>Neorg workspace personal <cr>")
vim.keymap.set("n", "<leader>ww", "<cmd>Neorg workspace work <cr>")
vim.keymap.set("n", "<leader>wr", "<cmd>Neorg return <cr>")
vim.keymap.set("n", "<leader>jo", "<cmd>Neorg journal today <cr>")
vim.keymap.set("n", "<leader>jc", "<cmd>Neorg journal custom <cr>")
vim.keymap.set("n", "<leader>jn", "<cmd>Neorg journal tomorrow <cr>")
vim.keymap.set("n", "<leader>jp", "<cmd>Neorg journal yesterday <cr>")
vim.keymap.set("n", "<leader>jt", "<cmd>Neorg journal template <cr>")
end,
opts = {
load = {
["core.defaults"] = {},
["core.concealer"] = { config = { icon_preset = "diamond" } },
["core.dirman"] = { config = { workspaces = { personal = "~/notes/personal", work = "~/notes/work" } } },
["core.completion"] = { config = { engine = "nvim-cmp" } },
2023-05-23 16:52:45 +01:00
["core.journal"] = {},
["core.presenter"] = { config = { zen_mode = "zen-mode" } },
["core.ui.calendar"] = {},
},
},
}