summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor/orgmode.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/plugins/editor/orgmode.fnl')
-rw-r--r--fnl/plugins/editor/orgmode.fnl32
1 files changed, 28 insertions, 4 deletions
diff --git a/fnl/plugins/editor/orgmode.fnl b/fnl/plugins/editor/orgmode.fnl
index bb67b88..5324b8d 100644
--- a/fnl/plugins/editor/orgmode.fnl
+++ b/fnl/plugins/editor/orgmode.fnl
@@ -1,5 +1,28 @@
;; Orgmode for nvim.
+(local user-cmds [[:OrgAgendaPrompt
+ (lambda []
+ (let [orgmode (require :orgmode)]
+ (orgmode.action :agenda.prompt)))
+ {:nargs 0}]
+ [:OrgCapturePrompt
+ (lambda []
+ (let [orgmode (require :orgmode)]
+ (orgmode.action :capture.prompt)))
+ {:nargs 0}]])
+
+(local auto-cmds
+ [[:FileType
+ {:pattern :org
+ :callback (fn []
+ (tset vim.opt_local :conceallevel 2)
+ (tset vim.opt_local :concealcursor :nc))}]])
+
+(fn init []
+ (let [cmds (require :util.cmds)]
+ (cmds.create-user-cmds user-cmds)
+ (cmds.create-auto-cmds auto-cmds)))
+
(local templates
{:t {:description :Task :template "* TODO %?\n %u\n DEADLINE: %T\n"}
:m {:description :Meeting :template "* Meeting %?"}
@@ -11,14 +34,15 @@
:org_default_notes_file "~/.local/share/org/refile.org"
:org_agenda_templates templates})
-(fn setup []
- (let [orgmode (require :orgmode)]
+(fn config []
+ (let [orgmode (require :orgmode)
+ cmds (require :util.cmds)]
(orgmode.setup_ts_grammar)
(orgmode.setup opts)))
{1 :nvim-orgmode/orgmode
- :config (fn []
- (setup))
+ : config
+ : init
:event :BufReadPost
:keys [{1 :ga 2 :<cmd>OrgAgendaPrompt<cr> :desc "Open agenda prompt"}
{1 :gc 2 :<cmd>OrgCapturePrompt<cr> :desc "Open capture prompt"}