0

I am having trouble trying to configure the conf[Unix] mode to do indentation. I have a hook that indents the whole file when I save the file:

(defun indent-hook()
  "Indent before saving."
  (indent-region (point-min) (point-max))nil)
(add-hook 'before-save-hook 'indent-hook)

My configuration file will look like this when it tries to "indent":

Example:
{
value1 = "value";
value2 = "value";
value3 = "value";
...          
}

This is the outcome I want it to produce:

Example:
{
    value1 = "value";
    value2 = "value";
    value3 = "value";
    ...          
}

I have tried to change the mode to all the different variants of conf mode to no avail.

What do I configure in my .emacs file so it indents the way I want?

This is my current .emacs file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.