2 -- Create a function that deindents all lines according to the indentation of the first
4 local std = require("std")
5 local _, e = string.find(s, '^%s*')
6 local ss = std.string.split(s, '')
7 local dedent = function(str) return str:sub(e + 1) end
8 return std.functional.map(dedent, std.elems, ss)
11 ---@type LazyPluginSpec
14 "nvim-orgmode/orgmode",
16 org_agenda_files = { "~/org/**/*.org" },
17 org_default_notes_file = "~/org/refile.org",
25 win_split_mode = function(name)
26 local bufnr = vim.api.nvim_create_buf(false, true)
27 vim.api.nvim_buf_set_name(bufnr, name)
29 if name == "orgagenda" then
30 vim.cmd("botright 80vsplit")
31 local win = vim.api.nvim_get_current_win()
32 vim.api.nvim_win_set_buf(win, bufnr)
37 local width = math.floor((vim.o.columns * fill))
38 local height = math.floor((vim.o.lines * fill))
39 local row = math.floor((((vim.o.lines - height) / 2) - 1))
40 local col = math.floor(((vim.o.columns - width) / 2))
41 vim.api.nvim_open_win(bufnr, true, {
51 org_agenda_span = "week",
52 org_agenda_start_on_weekday = false,
53 org_agenda_start_day = "-2d",
54 org_archive_location = "archive/%s_archive::",
55 org_log_done = 'time',
56 org_log_into_drawer = "LOGBOOK",
57 org_startup_indented = "noindent",
58 org_tags_column = -80, -- flushright
59 org_todo_keywords = { "TODO(t)", "NEXT(n)", "WAITING(w)", "|", "DONE", "CANCELLED" },
60 org_todo_keyword_faces = {
61 TODO = ":foreground #bf616a",
62 NEXT = ":foreground blue",
63 WAITING = ":foreground yellow",
64 CANCELLED = ":foreground grey",
66 org_capture_templates = {
69 template = "* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:",
73 description = "Log Task",
80 description = "Log Task (work)",
85 target = "~/org/work.org",
89 description = "Journal",
90 template = "\n*** %u\n**** %U - %?",
91 target = "~/org/journal.org",
94 description = "Meeting",
95 template = "* Meeting %U\n%?",
96 target = "~/org/work.org",
97 headline = "Meetings",
102 { "nvim-neorg/neorg",
106 "nvim-lua/plenary.nvim",
109 opts = function(_, opts)
110 table.insert(opts.sources, { name = "neorg" })
116 ["core.defaults"] = {},
117 ["core.concealer"] = {
119 icon_preset = "diamond"
125 home = "~/norg/home",
127 default_workspace = "home",
130 ["core.keybinds"] = {
133 hook = function(keybinds)
134 -- keybinds.remap_key("norg", "i", "<M-CR>", "<C-CR>") -- rebind core.itero.next-iteration
135 keybinds.remap_event("all", "n", "<C-E>", "core.looking-glass.magnify-code-block")
139 ["core.completion"] = {
146 strategy = "by_path",
153 journal_folder = "journal",
156 ["core.looking-glass"] = {},
157 ["core.qol.todo_items"] = {},
158 ["core.tangle"] = {},
159 ["core.ui.calendar"] = {},