I would like to change the way tags are displayed in the org-mode buffer from this:
* Headline :tag1:tag2:tag3:
to this:
* Headline tag1 tag2 tag3
So basically, the changes I'm looking for are:
Start tags immediately after the headline.
Hide the : characters
Add a space in-between each tag, so that long lists of tags will wrap properly in visual line mode
Remove default bold formatting of tags and add a highlight
So far, I've been able to change the font face and add a highlight by customizing the Org Tag property. As a temp/hack, I made the : characters invisible by turning on hi-lock-mode and then M-x highlight-phrase [RET] : [RET] org-hide [RET]. But this only hides the colon—it doesn't actually create a real space. So tags still won't wrap properly in visual line mode. Also, this hides all colons, everywhere, not just the ones that separate tags.
Perhaps another option is to add the space but leave the colon?
* Headline :tag1 :tag2 :tag3
I've been auditioning this with the solarized-light theme. Here's a screenshot:

Any ideas, comments? Thanks!
As mentioned by @lawlist, the (setq org-tags-column 0) puts the tags immediately after headline.
To hide the colons associated with tags, I tried the approach suggested by @Tobias, by setting the display property of :. Putting this snippet in .emacs or init.el seems to work for me.
(font-lock-add-keywords 'org-mode
'(("^\\*+ "
":" nil nil
(0 (put-text-property (match-beginning 0) (match-end 0) 'display " ")))))
I was referring to the (matcher . anchored-highlighter) format of setting a Search-based Fontification:
"^\\*+ " part first matches an org heading":" searches for :: with a space, according to the doc on display specs that replaces the textsA screenshot (note I didn't set org-tags-column 0 so it aligns right, and the font coloring are set by customize-face RET org-tag RET):

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With