emacs.el
changeset 2 0c29010a8c83
parent 1 ede059431d20
child 3 47d5df23c502
equal deleted inserted replaced
1:ede059431d20 2:0c29010a8c83
     4 (setq-default load-path (cons "~/.emacs.d" load-path))                ; set default emacs load path
     4 (setq-default load-path (cons "~/.emacs.d" load-path))                ; set default emacs load path
     5 
     5 
     6 (setq-default ediff-split-window-function 'split-window-horizontally) ; diff horizontally
     6 (setq-default ediff-split-window-function 'split-window-horizontally) ; diff horizontally
     7 (setq-default x-select-enable-clipboard t)                            ; paste from X buffer
     7 (setq-default x-select-enable-clipboard t)                            ; paste from X buffer
     8 (setq-default inhibit-splash-screen t)                                ; disable splash screen
     8 (setq-default inhibit-splash-screen t)                                ; disable splash screen
     9 (setq-default indicate-empty-lines t)                                 ; show empty lines
     9 ;;(setq-default show-trailing-whitespace t)                             ; show trailing whitespace
    10 (setq-default show-trailing-whitespace t)                             ; show trailing whitespace
       
    11 (put 'set-goal-column 'disabled nil)                                  ; enable goal column setting
    10 (put 'set-goal-column 'disabled nil)                                  ; enable goal column setting
    12 (put 'narrow-to-region 'disabled nil)                                 ; enable hiding
    11 (put 'narrow-to-region 'disabled nil)                                 ; enable hiding
    13 
    12 
    14 (display-time-mode t)                                                 ; show clock
    13 (display-time-mode t)                                                 ; show clock
    15 (column-number-mode t)                                                ; show column numbers
    14 (column-number-mode t)                                                ; show column numbers
    21 (add-hook 'text-mode-hook 'flyspell-mode t)                           ; spellcheck text
    20 (add-hook 'text-mode-hook 'flyspell-mode t)                           ; spellcheck text
    22 
    21 
    23 ;; coding
    22 ;; coding
    24 (which-func-mode t)                                                   ; show current function
    23 (which-func-mode t)                                                   ; show current function
    25 (show-paren-mode t)                                                   ; show matching paren
    24 (show-paren-mode t)                                                   ; show matching paren
       
    25 (transient-mark-mode t)                                               ; show highlighting
    26 (global-font-lock-mode t)                                             ; syntax highlighting
    26 (global-font-lock-mode t)                                             ; syntax highlighting
    27 (transient-mark-mode t)                                               ; show highlighting
    27 (global-whitespace-mode t)                                            ; show whitespace
       
    28 (setq-default whitespace-style '(tab-mark trailing tabs empty))       ; what whitespace elements to show
    28 (add-hook 'before-save-hook 'whitespace-cleanup)                      ; cleanup whitespace on exit
    29 (add-hook 'before-save-hook 'whitespace-cleanup)                      ; cleanup whitespace on exit
    29 (load "hoersten-pastebin-region")                                     ; send selected text to pastebin
    30 (load "hoersten-pastebin-region")                                     ; send selected text to pastebin
    30 (load "mercurial")                                                    ; load mercurial mode
    31 (load "mercurial")                                                    ; load mercurial mode
    31 (load "ahg")                                                          ; load suplimental mercurial mode
    32 (load "ahg")                                                          ; load suplimental mercurial mode
    32 (load "hoersten-c-style")                                             ; load c specific lisp
    33 (load "hoersten-c-style")                                             ; load c specific lisp
    40 
    41 
    41 ;; haskell
    42 ;; haskell
    42 (setq haskell-font-lock-symbols 'unicode)
    43 (setq haskell-font-lock-symbols 'unicode)
    43 
    44 
    44 ;; use only spaces for alignment
    45 ;; use only spaces for alignment
    45 (global-set-key (kbd "C-c a") 'align-with-spaces)  ; align
    46 (global-set-key (kbd "C-c a") 'align-with-spaces) ; align
    46 (defun align-with-spaces (beg end pattern)
    47 (defun align-with-spaces (beg end pattern)
    47   "Align selected using only spaces for whitespace."
    48   "Align selected using only spaces for whitespace."
    48   (interactive "r\nsAlign by: ")
    49   (interactive "r\nsAlign by: ")
    49   (let ((indent-tabs-mode nil))
    50   (let ((indent-tabs-mode nil))
    50     (align-string beg end pattern 1)
    51     (align-string beg end pattern 1)
    59 (setq-default comint-scroll-to-bottom-on-input t)  ; only type on prompt
    60 (setq-default comint-scroll-to-bottom-on-input t)  ; only type on prompt
    60 (setq-default comint-scroll-show-maximum-output t) ; place text at bottom
    61 (setq-default comint-scroll-show-maximum-output t) ; place text at bottom
    61 
    62 
    62 ;; map file extensions to modes
    63 ;; map file extensions to modes
    63 (setq-default auto-mode-alist
    64 (setq-default auto-mode-alist
    64 	      (append
    65               (append
    65 	       '(("\\.ipp$" . c++-mode)
    66                '(("\\.ipp$" . c++-mode)
    66 		 ("\\.inl$" . c++-mode)
    67                  ("\\.inl$" . c++-mode)
    67 		 ("SCons"   . python-mode)
    68                  ("SCons"   . python-mode)
    68 		 ("\\.jj$"  . java-mode))
    69                  ("\\.jj$"  . java-mode))
    69 	       auto-mode-alist))
    70                auto-mode-alist))
    70 
    71 
    71 ;; x stuff
    72 ;; x stuff
    72 (if (not window-system)
    73 (if (not window-system)
    73     (menu-bar-mode nil) ; remove menu bar in no-x mode
    74     (menu-bar-mode nil) ; remove menu bar in no-x mode
    74   (tool-bar-mode nil)   ; remove tool bar
    75   (tool-bar-mode nil)   ; remove tool bar