1

I would like to run delete-trailing-whitespace for files with extension .yaml only. Can someone please supply the elisp to do this?

1

1 Answer 1

5
(add-hook 'yaml-mode-hook
          (lambda ()
            (add-hook 'before-save-hook
                      #'delete-trailing-whitespace
                      nil "local")))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.