Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to *nix, and have installed Ubuntu as it seems to be a pretty friendly distro. Lately, meaning the past two days, I have been trying to learn and play with emacs. However, I have gotten to the point that I want to try customizing it and learning new things. I have tried to configure it to set the mode to org-mode whenever I make/load a .org file using this code:

(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)

I was told that this goes into my .emacs file, under my home directory. I have attempted to find this file, using ls -a of course, and to create it, and every other variation of getting this .emacs file since it wasn't there when I looked for it. However .emacs.d was there, with some random files that were not in any lisp language, so I assumed they were not what I wanted. Any help would be greatly appreciated.

share|improve this question

There isn't a default .emacs file. You will have to create it. Files with names that start with a dot (.) are hidden by default.

To create/edit the file in emacs open ~/.emacs either as emacs ~/.emacs or from within emacs. The directory .emacs.d is usually contains the autosave list and other working files.

share|improve this answer

Your .emacs wont' exist until you create it. Within Emacs, open ~/.emacs. Emacs will also try ~/.emacs.d/init.el if it can't find ~/.emacs.

Note that you don't need the first two lines (org-install and auto-mode-alist): they're only required if you install org-mode independently from Emacs, but org-mode ships with Emacs these days.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .