emacs.el
changeset 4 0fda818a8b6a
parent 3 47d5df23c502
child 5 59b1838be594
equal deleted inserted replaced
3:47d5df23c502 4:0fda818a8b6a
     1 ;; ~/.emacs - Luke Hoersten - v4.0
     1 ;; ~/.emacs
       
     2 ;; Luke Hoersten <[email protected]>
     2 
     3 
     3 ;; general
     4 ;; general
     4 (setq-default load-path (cons "~/.emacs.d" load-path))                ; set default emacs load path
     5 (setq-default load-path (cons "~/.emacs.d/" load-path))               ; set default emacs load path
       
     6 (setq-default user-mail-address "[email protected]")
     5 
     7 
     6 (setq-default ediff-split-window-function 'split-window-horizontally) ; diff horizontally
     8 (setq-default ediff-split-window-function 'split-window-horizontally) ; diff horizontally
     7 (setq-default x-select-enable-clipboard t)                            ; paste from X buffer
     9 (setq-default x-select-enable-clipboard t)                            ; paste from X buffer
     8 (setq-default inhibit-splash-screen t)                                ; disable splash screen
    10 (setq-default inhibit-splash-screen t)                                ; disable splash screen
     9 (put 'set-goal-column 'disabled nil)                                  ; enable goal column setting
    11 (put 'set-goal-column 'disabled nil)                                  ; enable goal column setting
    19 (add-hook 'text-mode-hook 'flyspell-mode t)                           ; spellcheck text
    21 (add-hook 'text-mode-hook 'flyspell-mode t)                           ; spellcheck text
    20 
    22 
    21 ;; coding
    23 ;; coding
    22 (which-func-mode t)                                                   ; show current function
    24 (which-func-mode t)                                                   ; show current function
    23 (show-paren-mode t)                                                   ; show matching paren
    25 (show-paren-mode t)                                                   ; show matching paren
       
    26 (setq-default show-paren-style 'mixed)
    24 (transient-mark-mode t)                                               ; show highlighting
    27 (transient-mark-mode t)                                               ; show highlighting
    25 (global-font-lock-mode t)                                             ; syntax highlighting
    28 (global-font-lock-mode t)                                             ; syntax highlighting
    26 (global-whitespace-mode t)                                            ; show whitespace
    29 (global-whitespace-mode t)                                            ; show whitespace
    27 (setq-default whitespace-style '(tab-mark trailing tabs empty))       ; what whitespace elements to show
    30 (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
    31 (add-hook 'before-save-hook 'whitespace-cleanup)                      ; cleanup whitespace on exit
    29 (load "hoersten-pastebin-region")                                     ; send selected text to pastebin
    32 (global-set-key (kbd "C-c c") 'compile)                               ; compile
    30 (load "mercurial")                                                    ; load mercurial mode
    33 
    31 (load "ahg")                                                          ; load suplimental mercurial mode
    34 (require 'hoersten-pastebin-region)                                   ; send selected text to pastebin
    32 (load "hoersten-c-style")                                             ; load c specific lisp
    35 (require 'mercurial)                                                  ; load mercurial mode
    33 (global-set-key (kbd "C-c c") 'compile)
    36 (require 'hoersten-c-style)                                           ; load c specific lisp
       
    37 
       
    38 (require 'pretty-mode)                                                ; convert characters to unicode
       
    39 (global-pretty-mode t)
       
    40 (setq haskell-font-lock-symbols 'unicode)
       
    41 
       
    42 (require 'yasnippet)
       
    43 (yas/initialize)
       
    44 (yas/load-directory "~/.emacs.d/snippets/")
    34 
    45 
    35 ;; gdb settings
    46 ;; gdb settings
    36 (setq-default gdb-many-windows t)                                     ; gdb many windows
    47 (setq-default gdb-many-windows t)                                     ; gdb many windows
    37 (setq-default gdb-use-separate-io-buffer t)                           ; gdb stdio output
    48 (setq-default gdb-use-separate-io-buffer t)                           ; gdb stdio output
    38 (setq-default gud-tooltip-mode t)                                     ; mouse hover variables
    49 (setq-default gud-tooltip-mode t)                                     ; mouse hover variables
    39 (global-set-key (kbd "C-c g") 'gdb)                                   ; gdb
    50 (global-set-key (kbd "C-c g") 'gdb)                                   ; gdb
    40 
       
    41 ;; haskell
       
    42 (setq haskell-font-lock-symbols 'unicode)
       
    43 
    51 
    44 ;; use only spaces for alignment
    52 ;; use only spaces for alignment
    45 (global-set-key (kbd "C-c a") 'align-with-spaces) ; align
    53 (global-set-key (kbd "C-c a") 'align-with-spaces) ; align
    46 (defun align-with-spaces (beg end pattern)
    54 (defun align-with-spaces (beg end pattern)
    47   "Align selected using only spaces for whitespace."
    55   "Align selected using only spaces for whitespace."
    71 ;; x stuff
    79 ;; x stuff
    72 (if (not window-system)
    80 (if (not window-system)
    73     (menu-bar-mode nil) ; remove menu bar in no-x mode
    81     (menu-bar-mode nil) ; remove menu bar in no-x mode
    74   (tool-bar-mode nil)   ; remove tool bar
    82   (tool-bar-mode nil)   ; remove tool bar
    75   (scroll-bar-mode nil) ; remove scroll bar
    83   (scroll-bar-mode nil) ; remove scroll bar
    76   (custom-set-faces '(default ((t (:background "#000000" :foreground "#ffffff" :height 100 :family "DejaVu Sans Mono")))))
    84   (custom-set-faces '(default ((t (:background "#000000" :foreground "#ffffff" :height 101 :family "DejaVu Sans Mono")))))
    77   (setq default-frame-alist '((width . 100) (height . 50) (menu-bar-lines . 1)))
    85   (setq default-frame-alist '((width . 100) (height . 50) (menu-bar-lines . 1)))
    78 
    86 
    79   ;; twilight theme
    87   ;; twilight theme
    80   (require 'color-theme)
    88   (require 'color-theme)
    81   (load "color-theme-twilight")
    89   (load "color-theme-twilight")