I have installed EmacsW32. I need to edit my
Where is the
.emacs file located on Windows?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
I don't actually know, since (being a relative newcomer to Emacs and thus not having done any customization) I don't have a
.emacs for my (WinXP) desktop, but I do have a directory,
%USERPROFILE%\Application Data\.emacs.d I'd put it there and see if it works.
From the GNU Emacs FAQ for MS Windows:
3.5 Where do I put my init file?
On Windows, the .emacs file may be called _emacs for backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name, because Explorer cannot create a file with a name starting with a dot, even though the filesystem and most other programs can handle it. In Emacs 22 and later, the init file may also be called .emacs.d/init.el. Many of the other files that are created by lisp packages are now stored in the .emacs.d directory too, so this keeps all your Emacs related files in one place.
All the files mentioned above should go in your HOME directory. The HOME directory is determined by following the steps below:
- If the environment variable HOME is set, use the directory it indicates.
- If the registry entry HKCU\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates.
- If the registry entry HKLM\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates. Not recommended, as it results in users sharing the same HOME directory.
- If C:.emacs exists, then use C:/. This is for backward compatibility, as previous versions defaulted to C:/ if HOME was not set.
- Use the user's AppData directory, usually a directory called Application Data under the user's profile directory, the location of which varies according to Windows version and whether the computer is part of a domain.
Within Emacs, <~> at the beginning of a file name is expanded to your HOME directory, so you can always find your .emacs file with C-x C-f ~/.emacs.
In my Swedish version of Windows 7 Professional, .emacs and/or .emacs.d/ are placed in
For Windows 10, find the place of the init file or GNU Emacs 25' the place of the
.emacs file or
.emacs.d folder is in the
Or some sources will write it as
%HOMEPATH%\AppData\Roaming\.emacs, in which that homepath is
c:/users/yourusernamehere in my opinion.
So, let's assume that you don't know how to get there. Open GNU Emacs and enter
Ctrl-x Ctrl-f which means find, and then write the tilde
~ and then press
Enter that will lead you to the folder where is
.emacs file or
.emacs.d folder or
init file is located.
Edit: GNU Emacs is looking for these three files, so be careful when naming them, because Emacs will look for these three files:
.emacs in home folder,
.emacs.el in home folder or
Here is the official GNU Emacs Manual excerpt:
When Emacs is started, it normally tries to load a Lisp program from an initialization file, or init file for short. This file, if it exists, specifies how to initialize Emacs for you. Emacs looks for your init file using the filenames
~/.emacs.d/init.el; you can choose to use any one of these three names (see Find Init). Here,
~/stands for your home directory.