Question

Is there a something I can put in my .emacs config file to set the default line-ending style for newly created files?

I'm using GNU emacs for windows, but would like newly created files to use unix-style (line-feed only) line endings by default.

Was it helpful?

Solution

I have the following in my Windows section of my config:

(setq-default buffer-file-coding-system 'utf-8-unix)
(setq eol-mnemonic-dos "(DOS)")
(setq eol-mnemonic-unix "\\")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top