init.el
changeset 29 b52bb6669eed
parent 28 8f4bd2f2cc06
child 30 5aa1ceff049d
equal deleted inserted replaced
28:8f4bd2f2cc06 29:b52bb6669eed
     1 ;; ~/.emacs.d/init.el (~/.emacs)
     1 ;; ~/.emacs.d/init.el (~/.emacs)
     2 ;; Luke Hoersten <[email protected]>
     2 ;; Luke Hoersten <[email protected]>
     3 
     3 
     4 ;; general
     4 ;; general
     5 (add-to-list 'load-path "~/.emacs.d/")                  ; set default emacs load path
     5 (add-to-list 'load-path "~/.emacs.d")                  ; set default emacs load path
     6 
     6 
     7 (setq-default
     7 (setq-default
     8  ediff-split-window-function 'split-window-horizontally ; diff horizontally
     8  ediff-split-window-function 'split-window-horizontally ; diff horizontally
     9  x-select-enable-clipboard t                            ; paste from X buffer
     9  x-select-enable-clipboard t                            ; paste from X buffer
    10  inhibit-splash-screen t                                ; disable splash screen
    10  inhibit-splash-screen t                                ; disable splash screen
    54    c-mode-common-hook
    54    c-mode-common-hook
    55    python-mode-hook
    55    python-mode-hook
    56    haskell-mode-hook
    56    haskell-mode-hook
    57    emacs-lisp-mode-hook))
    57    emacs-lisp-mode-hook))
    58 
    58 
    59 ;; use only spaces for alignment
       
    60 (global-set-key (kbd "C-c a") 'align-with-spaces)
       
    61 (defun align-with-spaces (beg end pattern)
       
    62   "Align selected using only spaces for whitespace."
       
    63   (interactive "r\nsAlign by: ")
       
    64   (let ((indent-tabs-mode nil))
       
    65     (align-string beg end pattern 1)
       
    66     (align-entire beg end)
       
    67     (untabify beg end)
       
    68     (indent-region beg end)
       
    69     (whitespace-cleanup-region beg end)))
       
    70 
       
    71 ;; X stuff
    59 ;; X stuff
    72 (if window-system
    60 (if window-system
    73     (progn
    61     (progn
    74       (tool-bar-mode -1)    ; remove tool bar
    62       (tool-bar-mode -1)    ; remove tool bar
    75       (scroll-bar-mode -1)  ; remove scroll bar
    63       (scroll-bar-mode -1)  ; remove scroll bar
    92  )
    80  )
    93 
    81 
    94 ;;;;;;;;;;;;; includes & requires ;;;;;;;;;;;;;
    82 ;;;;;;;;;;;;; includes & requires ;;;;;;;;;;;;;
    95 
    83 
    96 ;; includes
    84 ;; includes
    97 (require 'hoersten-pastebin-region) ; send selected text to pastebin
    85 (require 'hoersten-align-with-spaces) ; use only spaces for alignment
    98 (require 'hoersten-c-style)         ; load c specific lisp
    86 (require 'hoersten-pastebin-region)   ; send selected text to pastebin
    99 (require 'vala-mode)                ; vala programming language
    87 (require 'hoersten-c-style)           ; load c specific lisp
       
    88 (require 'vala-mode)                  ; vala programming language
   100 
    89 
   101 ;; nav mode
    90 ;; nav mode
   102 (add-to-list 'load-path "~/.emacs.d/nav/")
    91 (add-to-list 'load-path "~/.emacs.d/nav")
   103 (require 'nav)
    92 (require 'nav)
   104 
    93 
   105 ;; unicode
    94 ;; unicode
   106 (require 'pretty-mode)
    95 (require 'pretty-mode)
   107 (global-pretty-mode t)
    96 (global-pretty-mode t)
   108 
    97 
   109 ;; snippets
    98 ;; snippets
   110 (add-to-list 'load-path "~/.emacs.d/yasnippet/")
    99 (add-to-list 'load-path "~/.emacs.d/yasnippet")
   111 (require 'yasnippet)
   100 (require 'yasnippet)
   112 (yas/initialize)
   101 (yas/initialize)
   113 (yas/load-directory "~/.emacs.d/yasnippet/snippets/")
   102 (yas/load-directory "~/.emacs.d/yasnippet/snippets")
       
   103 (setq-default yas/prompt-functions '(yas/ido-prompt yas/dropdown-prompt)) ; use ido for multiple snippets
   114 
   104 
   115 ;; python mode
   105 ;; python mode
   116 (add-hook
   106 (add-hook
   117  'python-mode-hook
   107  'python-mode-hook
   118  (lambda ()
   108  (lambda ()
   127  (lambda ()
   117  (lambda ()
   128    (haskell-indentation-mode nil)
   118    (haskell-indentation-mode nil)
   129    (haskell-indent-mode t)
   119    (haskell-indent-mode t)
   130    (capitalized-words-mode t)
   120    (capitalized-words-mode t)
   131    (haskell-doc-mode t)
   121    (haskell-doc-mode t)
   132    ;; (imenu-add-menubar-index t)
   122    (imenu-add-menubar-index t)
   133    (setq
   123    (setq
   134     haskell-font-lock-symbols 'unicode
   124     haskell-font-lock-symbols 'unicode
   135     haskell-indent-offset 3)))
   125     haskell-indent-offset 3))
       
   126  t ;; append instead of prepend else haskell-mode overwrites these settings
       
   127  )
   136 
   128 
   137 ;; zencoding html
   129 ;; zencoding html
   138 (require 'zencoding-mode)
   130 (require 'zencoding-mode)
   139 (add-hook 'sgml-mode-hook 'zencoding-mode) ; Auto-start on any markup modes
   131 (add-hook 'sgml-mode-hook 'zencoding-mode) ; Auto-start on any markup modes
   140 
   132