orgmode
orgmode copied to clipboard
Aligning tags
Does this feature exist in Emacs orgmode core?
N/A
Orgmode link
Is there any function that can be called to realign tags to the defined margin? When manually adding tags by just typing the keywords :TAG1:TAG2:
or the like it's cumbersome to align them with the other tags. Would be great if there would be an easy way to realign tags in a document or marked area.
Feature value
Ease of use and better visuals
Additional context
No response
I started working on this (twice), but I have not yet decided how it would work. Every time a tag is added via the corresponding mapping? On every save of the buffer? Will it affect the whole buffer or just the current tree the cursor is at?
Your suggestion sounds viable as well, have not thought about it. However, it does not respect heading-tree boundaries. Not sure if that makes things tricky, just wanted to mention it. While explicitly marking the affected area will prevent unnecessary checking of tags that are already aligned, I personally think it's a bit cumbersome.
We should find out if and how Emacs orgmode handles this, before we take any further steps.
That was a quick one:
When called with a C-u prefix, all tags in the current buffer are aligned to that column, just to make things look nice.
Tags are automatically realigned after promotion, demotion, and TODO state changes
(source)
That sounds like a perfectly viable approach to me.
I'll start working on this
@tott this should now work. Thanks @kristijanhusak :slightly_smiling_face:
Here are some docs about this: https://github.com/nvim-orgmode/orgmode/blob/master/DOCS.md#formatting
Love it - works like a charm. Thanks!