summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor/orgmode.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-07-12 21:46:07 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-07-12 21:46:07 +0200
commitdf211fae51faddd7b47b78806660e21f6ec1a694 (patch)
tree9884c4945a1e60f19c52e4746953f0212b7fc8a7 /fnl/plugins/editor/orgmode.fnl
parent9ccdc18b7926ed5e069e7f305ac5ec304f87a65f (diff)
Debloat loading of plugins
Diffstat (limited to 'fnl/plugins/editor/orgmode.fnl')
-rw-r--r--fnl/plugins/editor/orgmode.fnl27
1 files changed, 27 insertions, 0 deletions
diff --git a/fnl/plugins/editor/orgmode.fnl b/fnl/plugins/editor/orgmode.fnl
new file mode 100644
index 0000000..bb67b88
--- /dev/null
+++ b/fnl/plugins/editor/orgmode.fnl
@@ -0,0 +1,27 @@
+;; Orgmode for nvim.
+
+(local templates
+ {:t {:description :Task :template "* TODO %?\n %u\n DEADLINE: %T\n"}
+ :m {:description :Meeting :template "* Meeting %?"}
+ :n {:description :Note :template "* NOTE %? :NOTE:\n %u\n"}})
+
+(local opts {:org_agenda_files ["~/.local/share/org/**/*"]
+ :org_hide_emphasis_markers true
+ :org_agenda_start_on_weekday false
+ :org_default_notes_file "~/.local/share/org/refile.org"
+ :org_agenda_templates templates})
+
+(fn setup []
+ (let [orgmode (require :orgmode)]
+ (orgmode.setup_ts_grammar)
+ (orgmode.setup opts)))
+
+{1 :nvim-orgmode/orgmode
+ :config (fn []
+ (setup))
+ :event :BufReadPost
+ :keys [{1 :ga 2 :<cmd>OrgAgendaPrompt<cr> :desc "Open agenda prompt"}
+ {1 :gc 2 :<cmd>OrgCapturePrompt<cr> :desc "Open capture prompt"}
+ {1 :gm
+ 2 "<cmd>Telescope orgmode search_headings theme=dropdown<cr>"
+ :desc "Search headings"}]}