init.lua/lua/plugins/orgmode.lua(view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
local dir = "~/org"
local function orgpath(path, not_a_file)
not_a_file = not_a_file or false
if not_a_file then
return dir .. "/" .. path
end
return dir .. "/" .. path .. ".org"
end
local function wrap(action, opts)
opts = opts or {}
return function()
return require("orgmode").action(action, opts)
end
end
---@type LazySpec
return {
"nvim-orgmode/orgmode",
ft = "org",
keys = {
"<leader>o",
{ "<leader>oo", ("<cmd>e " .. orgpath "refile" .. "<CR>") },
{ "<leader>oc", wrap "capture.prompt" },
{ "<leader>oa", wrap "agenda.prompt" },
},
dependencies = {
{ "akinsho/org-bullets.nvim", config = true },
},
---@module "orgmode"
---@type OrgDefaultConfig
---@diagnostic disable-next-line: missing-fields
opts = {
org_default_notes_file = orgpath "refile",
org_agenda_files = orgpath("**/*", true),
org_todo_keywords = { "TODO(t)", "INB(i)", "|", "DONE(d)" },
org_hide_emphasis_markers = true,
org_startup_indented = true,
org_startup_folded = "content", -- "showeverything"
mappings = {
prefix = "<leader>o",
org = {
org_open_at_point = "<CR>",
org_return = false,
org_export = false,
},
global = {
org_agenda = false,
org_capture = false,
},
},
org_capture_templates = {
t = {
description = "Task",
template = "* INB %?",
target = orgpath "todo",
},
i = { description = "Inbox", template = "* INB %?" },
w = {
description = "New vocab",
template = "* %? :vocab:",
headline = "new vocab",
},
},
},
}
|