init.el
changeset 61 c0319c5df048
parent 60 8beb028f936c
child 62 e1b944f16acb
equal deleted inserted replaced
60:8beb028f936c 61:c0319c5df048
    32 (transient-mark-mode t)                   ; show highlighting
    32 (transient-mark-mode t)                   ; show highlighting
    33 (global-font-lock-mode t)                 ; syntax highlighting
    33 (global-font-lock-mode t)                 ; syntax highlighting
    34 (global-set-key (kbd "C-c c") 'compile)   ; compile
    34 (global-set-key (kbd "C-c c") 'compile)   ; compile
    35 (global-set-key (kbd "C-c r") 'recompile) ; recompile
    35 (global-set-key (kbd "C-c r") 'recompile) ; recompile
    36 (global-set-key (kbd "C-c a") 'align-regexp) ; align
    36 (global-set-key (kbd "C-c a") 'align-regexp) ; align
       
    37 (global-set-key (kbd "C-c g") 'rgrep)     ; grep
    37 (subword-mode t)                          ; move by camelCase words
    38 (subword-mode t)                          ; move by camelCase words
    38 
    39 
    39 
    40 
    40 ;;; Darwin
    41 ;;; Darwin
    41 (setq is-mac (equal system-type 'darwin))
    42 (setq is-mac (equal system-type 'darwin))
    72 (setq-default
    73 (setq-default
    73  whitespace-line-column 120                             ; column width
    74  whitespace-line-column 120                             ; column width
    74  whitespace-style                                       ; whitespace to highlight
    75  whitespace-style                                       ; whitespace to highlight
    75  '(trailing lines-tail empty indentation
    76  '(trailing lines-tail empty indentation
    76             space-before-tab space-after-tab))
    77             space-before-tab space-after-tab))
    77 
       
    78 ;;; python-mode
       
    79 (add-hook 'python-mode-hook '(setq tab-width 4))
       
    80 
    78 
    81 ;;; org-mode
    79 ;;; org-mode
    82 (add-hook
    80 (add-hook
    83  'org-mode-hook
    81  'org-mode-hook
    84  (lambda ()
    82  (lambda ()
   118 
   116 
   119 ;; install packages
   117 ;; install packages
   120 (let ((ensure-installed
   118 (let ((ensure-installed
   121        (lambda (name)
   119        (lambda (name)
   122          (unless (package-installed-p name) (package-install name))))
   120          (unless (package-installed-p name) (package-install name))))
   123       (packages
   121       (packages '(ac-js2 auto-complete expand-region ghc
   124        '(ac-js2 auto-complete expand-region
   122        ghci-completion haskell-mode iy-go-to-char js2-mode
   125                 flymake-haskell-multi ghc ghci-completion haskell-mode
   123        multiple-cursors rainbow-delimiters rainbow-mode
   126                 iy-go-to-char js2-mode multiple-cursors rainbow-delimiters
   124        skewer-mode solarized-theme yasnippet zencoding-mode
   127                 rainbow-mode skewer-mode solarized-theme yasnippet
   125        visual-regexp)))
   128                 zencoding-mode visual-regexp)))
       
   129   (mapc ensure-installed packages))
   126   (mapc ensure-installed packages))
   130 
   127 
   131 ;;; requires
   128 ;;; requires
   132 (require 'c-init)             ; c specific elisp
   129 (require 'c-init)             ; c specific elisp
   133 (require 'move-line)          ; move line up or down
   130 (require 'move-line)          ; move line up or down
   194    css-mode-hook
   191    css-mode-hook
   195    clojure-mode-hook
   192    clojure-mode-hook
   196    emacs-lisp-mode-hook))
   193    emacs-lisp-mode-hook))
   197 
   194 
   198 ;;; haskell-mode
   195 ;;; haskell-mode
       
   196 (autoload 'ghc-init "ghc" nil t)
   199 (add-hook
   197 (add-hook
   200  'haskell-mode-hook
   198  'haskell-mode-hook
   201  (lambda ()
   199  (lambda ()
   202    (flymake-haskell-multi-load)
   200    (ghc-init)
   203    (flymake-mode t)
   201    (flymake-mode t)
   204    (capitalized-words-mode t)
   202    (capitalized-words-mode t)
   205    (turn-on-haskell-indent)
   203    (turn-on-haskell-indent)
   206    (turn-on-haskell-doc-mode)
   204    (turn-on-haskell-doc-mode)
   207    (turn-on-haskell-decl-scan)
   205    (turn-on-haskell-decl-scan)
   208    (imenu-add-menubar-index)
   206    (imenu-add-menubar-index)
   209    (local-set-key (kbd "C-c i") 'haskell-navigate-imports) ; go to imports. prefix to return
   207    (local-set-key (kbd "C-c i") 'haskell-navigate-imports) ; go to imports. prefix to return
   210    (setq
   208    (setq
   211     haskell-font-lock-haddock t
   209     haskell-font-lock-haddock t
   212     haskell-stylish-on-save t
   210     haskell-stylish-on-save t
   213     haskell-program-name "ghci"
       
   214     haskell-indent-offset 4
   211     haskell-indent-offset 4
   215     whitespace-line-column 78)
   212     whitespace-line-column 78)))
   216    ))
       
   217 
   213 
   218 ;;; ghci-mode
   214 ;;; ghci-mode
   219 (add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)
   215 (add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)
   220 
   216 
   221 ;;; expand-region
   217 ;;; expand-region