Configure .emacs file

From Notes_Wiki
Revision as of 03:57, 7 January 2013 by Saurabh (talk | contribs)

<yambe:breadcrumb>Emacs</yambe:breadcrumb>

Configure .emacs file

Use following as .emacs configuration. If there are already few lines in .emacs file then these lines can be appended / prepended to existing file:

(setq load-path (cons "~/.emacs.d" load-path))

;;Preventing emacs from creating backup files
(setq make-backup-files nil)

;;Preventing emacs from creating auto-save files
(setq auto-save-default nil)

;;Use visual-line-mode for word wrap
(global-visual-line-mode 1)

;;Wrap lines at 60 columns
(set-fill-column 60)

;;Wrap lines at 60 columns and enable auto-fill-mode automatically
(setq-default fill-column 60)
(add-hook 'text-mode-hook 'turn-on-auto-fill)

;;Set default font-size to 160 (16pt)
(set-face-attribute 'default nil :height 160) 


;;Setting up Emacs for use with Erlang
;;Update the below mentioned paths appropriately based on installation
(add-to-list 'load-path "/usr/local/lib/erlang/lib/tools-2.6.7/emacs/")
(require 'erlang-start)

(add-to-list 'auto-mode-alist '("\\.erl?$" . erlang-mode))
(add-to-list 'auto-mode-alist '("\\.hrl?$" . erlang-mode))

(setq erlang-root-dir "/usr/local/lib/erlang")
(add-to-list 'exec-path "/usr/local/lib/erlang/bin")
(setq erlang-man-root-dir "/usr/local/lib/erlang/man")


;;Disable splash screen at start-up
(setq inhibit-splash-screen t)

;;Make emacs copy-paste M-w, C-y work with system copy-paste
(setq x-select-enable-clipboard t)

;;To maximize emacs window at start-up
(defun toggle-fullscreen ()
  (interactive)
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
                 '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
                 '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
)
(toggle-fullscreen)


;; PDFs visited in Org-mode are opened in Evince and not in the default choice
(add-hook 'org-mode-hook
      '(lambda ()
         (delete '("\\.pdf\\'" . default) org-file-apps)
         (add-to-list 'org-file-apps '("\\.pdf\\'" . "evince %s"))))



If you have installed ELPA (Emacs Lisp Package Archive) then it might have added few lines of its own.


<yambe:breadcrumb>Emacs</yambe:breadcrumb>