Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TravonteD/org-capture-filetype
A nvim-orgmode plugin that enables custom filetypes in capture templates
https://github.com/TravonteD/org-capture-filetype
neovim neovim-plugin orgmode orgmode-nvim
Last synced: 1 day ago
JSON representation
A nvim-orgmode plugin that enables custom filetypes in capture templates
- Host: GitHub
- URL: https://github.com/TravonteD/org-capture-filetype
- Owner: TravonteD
- License: apache-2.0
- Created: 2022-01-20T16:20:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T05:09:36.000Z (over 1 year ago)
- Last Synced: 2024-08-02T13:33:50.561Z (3 months ago)
- Topics: neovim, neovim-plugin, orgmode, orgmode-nvim
- Language: Lua
- Homepage:
- Size: 6.84 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* org-capture-filetype
A plugin that adds custom filetypes to orgmode captures
** Why?
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.*** Usage
This plugins replaces the default =open_template= method in nvim-orgmode.
So it must be required /after/ your orgmode configuration.#+begin_src lua
require('orgmode').setup(opts)
require('org-capture-filetype')
#+end_srcAdding 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)#+begin_src fennel
{:description "Ledger Entry"
:template "\n%<%m-%d> %^{Description}\n %?"
:target (string.format "~/.local/ledger/%s.ledger" (vim.fn.strftime "%Y-%m"))
:filetype :ledger}
#+end_src