zkry / yaml-pro

Edit YAML in Emacs like a pro
GNU General Public License v3.0
137 stars 9 forks source link

Allow customising the path element separator #53

Closed nbarrientos closed 6 months ago

nbarrientos commented 6 months ago

This YAML seems to be legal:

---
a:
  b:
    c.d: test
   # ^ here

Some people in the wild like using dots in key names so in order to better see what's a key and what's a sublevel when displaying node paths (imenu, eldoc) it might make sense to allow the user to customise how labels are generated by customising the separator.

After this patch:

(setq yaml-pro-ts-path-element-separator ?·)

would label the node above "here" as a·b·c.d, clearly showing the hierarchy and the key names.

The current separator (dot) is respected and set as default.

zkry commented 6 months ago

Thanks for this! this is a good idea.