anli
anli

Reputation: 377

How to indent/autoformat HOCON in EMACS?

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

Upvotes: 8

Views: 800

Answers (2)

Rickyson
Rickyson

Reputation: 11

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

Upvotes: 1

Brian Malehorn
Brian Malehorn

Reputation: 2685

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))

Upvotes: 1

Related Questions