init.el
changeset 40 886afd628fa2
parent 39 5a7c0a0cab49
child 42 ade8c2cc1b04
equal deleted inserted replaced
39:5a7c0a0cab49 40:886afd628fa2
     2 ;; Luke Hoersten <[email protected]>
     2 ;; Luke Hoersten <[email protected]>
     3 
     3 
     4 
     4 
     5 ;;;; General ;;;;
     5 ;;;; General ;;;;
     6 (add-to-list 'load-path "~/.emacs.d")            ; set default emacs load path
     6 (add-to-list 'load-path "~/.emacs.d")            ; set default emacs load path
     7 (add-to-list 'load-path "~/.emacs.d/thirdparty") ; set default third party path
       
     8 
     7 
     9 (setq-default
     8 (setq-default
    10  ediff-split-window-function
     9  ediff-split-window-function
    11   'split-window-horizontally              ; diff horizontally
    10   'split-window-horizontally              ; diff horizontally
    12  x-select-enable-clipboard t              ; paste from X buffer
    11  x-select-enable-clipboard t              ; paste from X buffer
    13  inhibit-splash-screen t                  ; disable splash screen
    12  inhibit-splash-screen t                  ; disable splash screen
    14  truncate-lines t                         ; truncate, not wrap, lines
    13  truncate-lines t                         ; truncate, not wrap, lines
    15  indent-tabs-mode nil                     ; only uses spaces for indentation
    14  indent-tabs-mode nil                     ; only uses spaces for indentation
    16  split-width-threshold 181                ; min width to split window horizontially
    15  split-width-threshold 181                ; min width to split window horizontially
       
    16  split-height-threshold 120               ; min width to split window vertically
    17  reb-re-syntax 'string)                   ; use string syntax for regexp builder
    17  reb-re-syntax 'string)                   ; use string syntax for regexp builder
    18 
    18 
    19 (put 'set-goal-column 'disabled nil)      ; enable goal column setting
    19 (put 'set-goal-column 'disabled nil)      ; enable goal column setting
    20 (put 'narrow-to-region 'disabled nil)     ; enable hiding
    20 (put 'narrow-to-region 'disabled nil)     ; enable hiding
    21 (put 'narrow-to-page 'disabled nil)
    21 (put 'narrow-to-page 'disabled nil)
    28 ;;; coding
    28 ;;; coding
    29 (which-func-mode t)                       ; show current function
    29 (which-func-mode t)                       ; show current function
    30 (show-paren-mode t)                       ; show matching paren
    30 (show-paren-mode t)                       ; show matching paren
    31 (transient-mark-mode t)                   ; show highlighting
    31 (transient-mark-mode t)                   ; show highlighting
    32 (global-font-lock-mode t)                 ; syntax highlighting
    32 (global-font-lock-mode t)                 ; syntax highlighting
    33 (setq-default compile-command "scons ")   ; compile command
       
    34 (global-set-key (kbd "C-c c") 'compile)   ; compile
    33 (global-set-key (kbd "C-c c") 'compile)   ; compile
    35 (global-set-key (kbd "C-c r") 'recompile) ; recompile
    34 (global-set-key (kbd "C-c r") 'recompile) ; recompile
    36 (global-set-key
    35 (global-set-key
    37  (kbd "C-c C-c")
    36  (kbd "C-c C-c")
    38  'comment-or-uncomment-region)            ; toggle region comment
    37  'comment-or-uncomment-region)            ; toggle region comment
    39 
    38 
    40 ;;; Darwin
    39 ;;; Darwin
    41 (if (string-match "darwin" (emacs-version))
    40 (if (string-match "darwin" (emacs-version))
    42     (progn
    41     (progn
    43       (setq-default ns-command-modifier 'control)
    42       (setq-default ns-command-modifier 'control)
    44       (tabbar-mode nil)
    43       (tabbar-mode nil)))
    45       (menu-bar-mode t)))
       
    46 
    44 
    47 ;;; Xorg
    45 ;;; Xorg
    48 (if window-system
    46 (if window-system
    49     (progn
    47     (progn
    50       (defun get-font ()
    48       (defun get-font ()
    99             space-before-tab space-after-tab))
    97             space-before-tab space-after-tab))
   100 
    98 
   101 ;;; python-mode
    99 ;;; python-mode
   102 (add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode t)))
   100 (add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode t)))
   103 
   101 
   104 ;;; haskell-mode
       
   105 ;; scion
       
   106 (if (file-exists-p "~/.cabal/share/scion-0.1.0.10/emacs")
       
   107     (progn
       
   108       (add-to-list 'load-path "~/.cabal/share/scion-0.1.0.10/emacs")
       
   109       (require 'scion)
       
   110       (setq scion-program "~/.cabal/bin/scion-server")
       
   111       (add-hook
       
   112        'haskell-mode-hook
       
   113        (lambda ()
       
   114          (scion-mode 1)
       
   115          (scion-flycheck-on-save 1)
       
   116          (setq scion-completing-read-function 'ido-completing-read)))))
       
   117 
       
   118 (add-hook
       
   119  'haskell-mode-hook
       
   120  (lambda ()
       
   121    (haskell-indentation-mode nil)
       
   122    (haskell-indent-mode t)
       
   123    (capitalized-words-mode t)
       
   124    (haskell-doc-mode t)
       
   125    (setq
       
   126     haskell-indent-offset 4
       
   127     whitespace-line-column 120))
       
   128  t) ; append instead of prepend else haskell-mode overwrites these settings
       
   129 
       
   130 ;;; org-mode
   102 ;;; org-mode
   131 (add-hook
   103 (add-hook
   132  'org-mode-hook
   104  'org-mode-hook
   133  (lambda ()
   105  (lambda ()
   134    (local-set-key (kbd "M-p") 'org-move-item-up)
   106    (local-set-key (kbd "M-p") 'org-move-item-up)
   153    (ibuffer-switch-to-saved-filter-groups "default")))
   125    (ibuffer-switch-to-saved-filter-groups "default")))
   154 
   126 
   155 
   127 
   156 ;;;; Requires ;;;;
   128 ;;;; Requires ;;;;
   157 
   129 
   158 (require 'hoersten-c-style)   ; load c specific lisp
   130 (add-to-list 'load-path "~/.emacs.d/thirdparty") ; set default third party path
       
   131 
       
   132 ;;; language init
       
   133 (require 'c-init)             ; c specific elisp
       
   134 (require 'haskell-init)       ; haskell specific elisp
       
   135 (require 'vala-mode)          ; vala programming language
       
   136 
       
   137 ;;; function init
   159 (require 'align-with-spaces)  ; use only spaces for alignment
   138 (require 'align-with-spaces)  ; use only spaces for alignment
   160 (require 'pastebin-region)    ; send selected text to pastebin
   139 (require 'pastebin-region)    ; send selected text to pastebin
   161 (require 'move-line)          ; move line up or down
   140 (require 'move-line)          ; move line up or down
   162 (require 'vala-mode)          ; vala programming language
       
   163 (require 'rainbow-delimiters) ; multi-colored parens
   141 (require 'rainbow-delimiters) ; multi-colored parens
   164 
   142 
   165 ;;; yasnippets
   143 ;;; yasnippets
   166 (add-to-list 'load-path "~/.emacs.d/thirdparty/yasnippet")
   144 (add-to-list 'load-path "~/.emacs.d/thirdparty/yasnippet")
   167 (require 'yasnippet)
   145 (require 'yasnippet)