How to indent/autoformat HOCON in EMACS?
Asked Answered
T

2

8

Haven't found a way to indent/autoformat HOCON config files. What is you way here?

Transcendent answered 25/7, 2016 at 8:13 Comment(1)
You can try kotlin-mode, reindent, then conf-mode.Range
G
1

I'm fairly certain there isn't an Emacs major mode for HOCON. But it looks like it's similar to JavaScript, so you can make .hocon load as JavaScript by adding this to your .emacs:

(add-to-list 'auto-mode-alist '("\\.hocon\\'" . javascript-mode))
Gemology answered 25/7, 2016 at 19:33 Comment(1)
Unfortunately it looks similar to JS, but it isn't similar enough :)Transcendent
D
1

I think it's quite similar to the syntax of HCL. You might be interested in using emacs-hcl-mode for editing HOCON files.

Dichromate answered 24/9, 2021 at 18:29 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Outbalance

© 2022 - 2024 — McMap. All rights reserved.