]> git.rmz.io Git - dotfiles.git/blob - nvim/lua/plugins/productivity.lua
lazyvim: absorb snacks.vim init config
[dotfiles.git] / nvim / lua / plugins / productivity.lua
1 -- TODO: finish this
2 -- Create a function that deindents all lines according to the indentation of the first
3 local function d(s)
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)
9 end
10
11 ---@type LazyPluginSpec
12 return {
13 {
14 "nvim-orgmode/orgmode",
15 opts = {
16 org_agenda_files = { "~/org/**/*.org" },
17 org_default_notes_file = "~/org/refile.org",
18 mappings = {
19 prefix = "go",
20 global = {
21 org_agenda = "goa",
22 org_capture = "goc",
23 },
24 },
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)
28
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)
33 return
34 end
35
36 local fill = 0.8
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, {
42 relative = "editor",
43 width = width,
44 height = height,
45 row = row,
46 col = col,
47 style = "minimal",
48 border = "rounded",
49 })
50 end,
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",
65 },
66 org_capture_templates = {
67 t = {
68 description = "Task",
69 template = "* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:",
70 },
71 l = "Log Task",
72 lh = {
73 description = "Log Task",
74 template = [[
75 * DONE %?
76 SCHEDULED: %t
77 ]],
78 },
79 lw = {
80 description = "Log Task (work)",
81 template = [[
82 * DONE %?
83 SCHEDULED: %t
84 ]],
85 target = "~/org/work.org",
86 headline = "Tasks"
87 },
88 j = {
89 description = "Journal",
90 template = "\n*** %u\n**** %U - %?",
91 target = "~/org/journal.org",
92 },
93 m = {
94 description = "Meeting",
95 template = "* Meeting %U\n%?",
96 target = "~/org/work.org",
97 headline = "Meetings",
98 },
99 },
100 },
101 },
102 { "nvim-neorg/neorg",
103 lazy = false,
104 version = "*",
105 dependencies = {
106 "nvim-lua/plenary.nvim",
107 "luarocks.nvim",
108 },
109 opts = {
110 load = {
111 ["core.defaults"] = {},
112 ["core.concealer"] = {
113 config = {
114 icon_preset = "diamond"
115 }
116 },
117 ["core.dirman"] = {
118 config = {
119 workspaces = {
120 home = "~/norg/home",
121 },
122 default_workspace = "home",
123 },
124 },
125 ["core.keybinds"] = {
126 config = {
127 neorg_leader = "go",
128 hook = function(keybinds)
129 -- keybinds.remap_key("norg", "i", "<M-CR>", "<C-CR>") -- rebind core.itero.next-iteration
130 keybinds.remap_event("all", "n", "<C-E>", "core.looking-glass.magnify-code-block")
131 end,
132 },
133 },
134 ["core.summary"] = {
135 config = {
136 strategy = "by_path",
137 },
138 },
139 ["core.itero"] = {},
140 ["core.promo"] = {},
141 ["core.journal"] = {
142 config = {
143 journal_folder = "journal",
144 },
145 },
146 ["core.looking-glass"] = {},
147 ["core.qol.todo_items"] = {},
148 ["core.tangle"] = {},
149 ["core.ui.calendar"] = {},
150 },
151 }
152 },
153 }