Hi all so last night I started using Emacs and I enjoyed it. Now I am looking to customize the look to the solarized port of Emacs. Now question is where is the .emacs
file in windows 8.1? I have heard many answers to this question, I put my Emacs in C:\Emacs
. So any ideas?
3 Answers
From inside Emacs, you can find out the path and file name with this command:
C-h v user-init-file RET
Newer installations generally default to ~/.emacs.d but some custom installs put it in roaming or dropbox folders.
-
1You say "default to ~/.emacs.d" but that seems to bring us back to the original question of where is "~/.emacs(.d)" Commented Dec 5, 2017 at 22:54
You don't really need to know: just do C-x C-f ~/.emacs RET
and you'll be looking at the content of the file (most likely empty if you haven't done that earlier), which you can then edit and save.
Once in it, you can use M-x pwd RET
to know in which directory it is placed.
Most likely, it is located in your %USERPROFILE%
or %APPDATA%
dir. However, any of the following(those are already mentioned above, just summarizing here) can be used to find out the exact location:
- Type
C-h v user-init-file RET
. This will open a help window which will have the location of the init file. TypeC-x 1
orC-x k *Help* RET
to close the popup window. - Run the eval command with
M-: (getenv "HOME") RET
which will also give the init file location. Don't forget the parentheses because it is a lisp expression.
Thanks.
M-: (getenv "HOME")
. This will output the location of home directory, which is the directory where you can put.emacs
file or any other kind of init file.(emacs) Windows HOME
and(efaq-w32) Location of init file
.