2 files changed,
29 insertions(+),
4 deletions(-)
Author:
Smirnov Oleksandr
ss2316544@gmail.com
Committed at:
2024-12-15 19:21:55 +0200
Parent:
6802fbe
jump to
| M | lua/plugins/completion.lua |
| M | lua/plugins/orgmode.lua |
M
lua/plugins/completion.lua
@@ -101,6 +101,8 @@ end
end, }, sources = cmp.config.sources { + { name = "orgmode", group_index = 0, max_item_count = 3 }, + { name = "copilot", group_index = 1, max_item_count = 3 }, { name = "copilot", group_index = 2, max_item_count = 3 }, { name = "lazydev", group_index = 0 }, { name = "nvim_lsp", max_item_count = 12 },
M
lua/plugins/orgmode.lua
@@ -1,10 +1,21 @@
-local prefix = "<C-c>" +local prefix = "<leader>;" +local dir = "~/org" + +local function wrap(fn) + return function() + require("orgmode").action(fn) + end +end ---@type LazySpec return { "nvim-orgmode/orgmode", ft = { "org" }, - keys = { prefix }, + keys = { + { "<leader>;a", wrap "agenda.prompt" }, + { "<leader>;c", wrap "capture.prompt" }, + { "<leader>;o", ("<cmd>e %s/refile.org<cr>"):format(dir) }, + }, dependencies = { { "akinsho/org-bullets.nvim", config = true }, {@@ -19,10 +30,22 @@ },
---@module "orgmode" ---@type OrgDefaultConfig opts = { - org_default_notes_file = "~/org/refile.org", - org_agenda_files = "~/org/**/*", + org_default_notes_file = dir .. "/refile.org", + org_agenda_files = dir .. "/**/*", mappings = { prefix = prefix, + org = { + org_open_at_point = "<CR>", + org_return = false, + org_export = false, + }, + }, + org_capture_templates = { + t = { + description = "Task", + template = "* TODO %?", + target = "~/org/todolist.org", + }, }, }, }