Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is my .emacs file on Mac OS X

Tags:

emacs

macos

so i am trying to add the google go module to my .emacs file so that when I use emacs to edit my .go file it will have the appropriate indentations and highlight of the words. Ive looked online and it seems that I need to add the following code snippets to my .emacs file (which i cannot find!)

;; go mode
(setq load-path (cons "/usr/local/go/misc/emacs" load-path))
(require 'go-mode-load)

I have put go-mode-load.el and go-mode.el in my .emacs.d/ directory I believe i still need to find the .emacs file to add the code listed above I am running OS X if this helps. Can someone help me get this working thank you!

like image 253
user2895800 Avatar asked Oct 22 '13 17:10

user2895800


People also ask

Where is the .Emacs file Mac?

It should be in your home directory ( ~/. emacs ). If it doesn't exist, you can create it.

Is Emacs installed by default on Mac?

OS X comes with a preinstalled version of Emacs, but alas it is the outdated Emacs 22. Fortunately, obtaining a newer release is really simple. There are several popular ways to do it.

Where is Emacs init file?

Emacs normally finds your init file in a location under your home directory. See The Emacs Initialization File. Emacs looks for your init file using the filenames ~/. emacs.


2 Answers

Eval this with M-: (find-file user-init-file)

Emacs will then open what it considers your user initialization file.

I have

(global-set-key (kbd "<f12>") (lambda () (interactive) (find-file-other-window user-init-file))) 

in my .emacs so that i can easily edit this.

like image 182
p_wiersig Avatar answered Oct 06 '22 01:10

p_wiersig


The Emacs manual tells you:

This file, if it exists, specifies how to initialize Emacs for you.
Emacs looks for your init file using the filenames `~/.emacs', `~/.emacs.el',
or `~/.emacs.d/init.el'; you can choose to use any one of these three
names.  Here, `~/' stands for your home directory.

Most people use ~/.emacs, I think. Just do C-x C-f ~/.emacs to create it if you do not yet have one.

like image 25
Drew Avatar answered Oct 06 '22 00:10

Drew