What to do if I cannot find my emacs init file?

2019-01-12 05:04发布

I am trying to add haskell-mode to emacs by following these instructions:

http://doc.gnu-darwin.org/haskell-mode/installation-guide.html

This involves that I add some code to my ~/.emacs init file. However, my issue is that I cannot locate my emacs init file. I tried using find commands to locate it, as so:

find . -name "*emacs*"
find . -name "~/.emacs"

However none of these appear to be very successful, as I get either too many results, or no results.

So, given my situation, since I cannot locate my ~/.emacs init file, does this mean it does not exist? In that case, would it be smart to create one myself using the emacs editor? If so, are there any outstanding things I should know before attempting to create one?

2条回答
Rolldiameter
2楼-- · 2019-01-12 05:23

C-x C-f ~/.emacs will take you to it.

See the Emacs manual, nodes Init File and Find Init.

查看更多
Rolldiameter
3楼-- · 2019-01-12 05:39

To open your emacs init file, type M-: (find-file user-init-file) RET. If you only want to see its path, you can use C-h v user-init-file RET.

查看更多
登录 后发表回答