init.el
changeset 45 12715da9a300
parent 44 6e66ab8d9185
child 46 2c6b198426df
equal deleted inserted replaced
44:6e66ab8d9185 45:12715da9a300
    25 (windmove-default-keybindings)            ; move between windows with shift-arrow
    25 (windmove-default-keybindings)            ; move between windows with shift-arrow
    26 (fset 'yes-or-no-p 'y-or-n-p)             ; replace yes/no prompts
    26 (fset 'yes-or-no-p 'y-or-n-p)             ; replace yes/no prompts
    27 (global-hl-line-mode t)                   ; highlight current line
    27 (global-hl-line-mode t)                   ; highlight current line
    28 
    28 
    29 
    29 
    30 ;;; coding
    30 ;;; Coding
    31 (which-func-mode t)                       ; show current function
    31 (which-func-mode t)                       ; show current function
    32 (show-paren-mode t)                       ; show matching paren
    32 (show-paren-mode t)                       ; show matching paren
    33 (transient-mark-mode t)                   ; show highlighting
    33 (transient-mark-mode t)                   ; show highlighting
    34 (global-font-lock-mode t)                 ; syntax highlighting
    34 (global-font-lock-mode t)                 ; syntax highlighting
    35 (global-set-key (kbd "C-c c") 'compile)   ; compile
    35 (global-set-key (kbd "C-c c") 'compile)   ; compile
    36 (global-set-key (kbd "C-c r") 'recompile) ; recompile
    36 (global-set-key (kbd "C-c r") 'recompile) ; recompile
    37 (global-set-key
    37 
    38  (kbd "C-c C-c")
       
    39  'comment-or-uncomment-region)            ; toggle region comment
       
    40 
    38 
    41 ;;; Darwin
    39 ;;; Darwin
    42 (if (string-match "darwin" (emacs-version))
    40 (if (string-match "darwin" (emacs-version))
    43     (progn
    41     (progn
    44       (setq-default mac-command-modifier 'meta)))
    42       (setq-default mac-command-modifier 'meta)))
    48     (progn
    46     (progn
    49       (defun get-font ()
    47       (defun get-font ()
    50         "Get appropriate font based on system and hostname."
    48         "Get appropriate font based on system and hostname."
    51         (cond
    49         (cond
    52          ((string-match "darwin" (emacs-version)) "Menlo-12")
    50          ((string-match "darwin" (emacs-version)) "Menlo-12")
    53          ((string-match "HoldenCaulfield" (system-name)) "Ubuntu Mono-6.5")
    51          ((string-match "RichardParker"   (system-name)) "Ubuntu Mono-8.5")
    54          ((string-match "lhoersten-66113" (system-name)) "Ubuntu Mono-8.5")
    52          ((string-match "HoldenCaulfield" (system-name)) "Ubuntu Mono-10.5")
    55          ("Ubuntu Mono-10")))
    53          ((string-match "lhoersten-66113" (system-name)) "Ubuntu Mono-10.5")
       
    54          ("Ubuntu Mono-10.5")))
    56 
    55 
    57       (tool-bar-mode -1)      ; remove tool bar
    56       (tool-bar-mode -1)      ; remove tool bar
    58       (scroll-bar-mode -1)    ; remove scroll bar
    57       (scroll-bar-mode -1)    ; remove scroll bar
    59       (visual-line-mode t)    ; word wrap break on whitespace
    58       (visual-line-mode t)    ; word wrap break on whitespace
    60       (set-frame-font (get-font)))
    59       (set-frame-font (get-font)))
   125 (add-to-list 'load-path "~/.emacs.d/thirdparty") ; set default third party path
   124 (add-to-list 'load-path "~/.emacs.d/thirdparty") ; set default third party path
   126 
   125 
   127 ;;; language init
   126 ;;; language init
   128 (require 'c-init)             ; c specific elisp
   127 (require 'c-init)             ; c specific elisp
   129 (require 'haskell-init)       ; haskell specific elisp
   128 (require 'haskell-init)       ; haskell specific elisp
   130 (require 'color-theme-init)   ; haskell specific elisp
   129 (require 'color-theme-init)   ; color theme specific elisp
   131 (require 'vala-mode)          ; vala programming language
   130 (require 'vala-mode)          ; vala programming language
   132 (require 'rainbow-delimiters) ; multi-colored parens
   131 (require 'rainbow-delimiters) ; multi-colored parens
   133 
   132 
   134 ;;; function init
   133 ;;; function init
   135 (require 'align-with-spaces)  ; use only spaces for alignment
   134 (require 'align-with-spaces)  ; use only spaces for alignment