Search code examples
windowsemacschocolatey

Where do I place my .emacs file on Windows with emacs installed through chocolatey?


I am using chocolatey package manager on windows to manage my emacs installation. However, I don't know where to place my .emacs file.


Solution

  • Your .emacs file will be located in your home directory. There's a list of ways Emacs can determine what that directory is. In order, they are:

    1. If you've set the environment variable "HOME", it will be there. This is probably the most common way to set it.
    2. If you set the registry value "HKCU\SOFTWARE\GNU\Emacs\HOME", it will be there
    3. If you have C:\.emacs, it will use that (deprecated)
    4. Finally, it will look in your AppData directory.

    The easiest way to find it, if you don't want to manually set one of those values, is to use the command C-x C-f ~/.emacs from within Emacs. This will load the .emacs file in the correct location. Alternatively, you can use ~/.emacs.d/init.el, if you want to keep every Emacs related file in your home directory inside a single folder.