A plugin that adds custom filetypes to orgmode captures
orgmode capture templates are my most used feature.
I use it daily for journaling, bookmarking, task management, etc.
One thing that I also like to use it for is capturing ledger entries,
but since the templates all use the org
filetype for capture I’d lose out on my completion and formatting.
So I wrote this plugin so that I could have the full capability of my ledger config when capturing.
This plugins replaces the default open_template
method in nvim-orgmode.
So it must be required after your orgmode configuration.
require('orgmode').setup(opts)
require('org-capture-filetype')
Adding a filetype to a template is as simple as adding a filetype
key.
Here’s my ledger template for example (I use fennel, but it should be easy to understand)
{:description "Ledger Entry"
:template "\n%<%m-%d> %^{Description}\n %?"
:target (string.format "~/.local/ledger/%s.ledger" (vim.fn.strftime "%Y-%m"))
:filetype :ledger}