diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-08 02:49:49 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-08 02:49:49 +0100 |
commit | 86fc163e549d78136855ac2b45e91ffb2f43affc (patch) | |
tree | 20fab78a2ff2635af5ac95f2b2a11d9d07ace0e1 /fnl/config/orgmode.fnl | |
parent | 0d7f782cb4e68cff000beb00e8ab64308a66f3f0 (diff) |
Refactor config loading
Diffstat (limited to 'fnl/config/orgmode.fnl')
-rw-r--r-- | fnl/config/orgmode.fnl | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/fnl/config/orgmode.fnl b/fnl/config/orgmode.fnl index bc73bb7..99e55be 100644 --- a/fnl/config/orgmode.fnl +++ b/fnl/config/orgmode.fnl @@ -1,29 +1,24 @@ ;; Orgmode for nvim. -(module config.orgmode {autoload {nvim aniseed.nvim util config.util}}) -(nvim.ex.set :conceallevel=2) -(nvim.ex.set :concealcursor=nc) +(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"}}) -(def- 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}) -(defn- create-title [task] - (string.format "%s (%s)" task.category task.humanized_duration)) +(fn setup [] + (let [orgmode (require :orgmode)] + (tset vim.opt :conceallevel 2) + (tset vim.opt :concealcursor :nc) + (orgmode.setup_ts_grammar) + (orgmode.setup opts))) -(defn- create-subtitle [task] - (string.format "%s %s %s" (string.rep "*" task.level) task.todo - task.title)) - -(defn- get-date [task] (string.format "%s: %s" task.type (task.time:to_string))) - -(def- 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}) - -(let [orgmode (util.prequire :orgmode)] - (orgmode.setup_ts_grammar) - (orgmode.setup opts)) +{1 :nvim-orgmode/orgmode + :event :BufReadPost + :config (fn [] + (setup))} |