init.el
changeset 21 a48713acd5c1
parent 13 7dc464c4e2d3
child 22 a7906973ceb5
equal deleted inserted replaced
20:107db91ce789 21:a48713acd5c1
     7 (setq-default
     7 (setq-default
     8  ediff-split-window-function 'split-window-horizontally ; diff horizontally
     8  ediff-split-window-function 'split-window-horizontally ; diff horizontally
     9  x-select-enable-clipboard t                            ; paste from X buffer
     9  x-select-enable-clipboard t                            ; paste from X buffer
    10  inhibit-splash-screen t                                ; disable splash screen
    10  inhibit-splash-screen t                                ; disable splash screen
    11  truncate-lines t                                       ; truncate, not wrap, lines
    11  truncate-lines t                                       ; truncate, not wrap, lines
    12  indent-tabs-mode nil                                   ; mouse hover variables
    12  indent-tabs-mode nil                                   ; only uses spaces for indentation
    13  split-width-threshold 181)                             ; min width to split window horizontially
    13  split-width-threshold 181)                             ; min width to split window horizontially
    14 
    14 
    15 (put 'set-goal-column 'disabled nil)                    ; enable goal column setting
    15 (put 'set-goal-column 'disabled nil)                    ; enable goal column setting
    16 (put 'narrow-to-region 'disabled nil)                   ; enable hiding
    16 (put 'narrow-to-region 'disabled nil)                   ; enable hiding
       
    17 (put 'narrow-to-page 'disabled nil)
    17 
    18 
    18 (menu-bar-mode nil)                                     ; remove menu bar
    19 (menu-bar-mode nil)                                     ; remove menu bar
    19 (display-time-mode t)                                   ; show clock
    20 (display-time-mode t)                                   ; show clock
    20 (column-number-mode t)                                  ; show column numbers
    21 (column-number-mode t)                                  ; show column numbers
    21 (delete-selection-mode t)                               ; replace highlighted text
    22 (delete-selection-mode t)                               ; replace highlighted text
    28 ;; whitespace
    29 ;; whitespace
    29 (global-whitespace-mode t)                              ; show whitespace
    30 (global-whitespace-mode t)                              ; show whitespace
    30 (add-hook 'before-save-hook 'whitespace-cleanup)        ; cleanup whitespace on exit
    31 (add-hook 'before-save-hook 'whitespace-cleanup)        ; cleanup whitespace on exit
    31 (setq-default
    32 (setq-default
    32  whitespace-line-column 120                             ; column width
    33  whitespace-line-column 120                             ; column width
    33  whitespace-style                                       ; whitespace elements to show
    34  whitespace-style '(trailing lines-tail empty
    34  '(tabs tab-mark trailing lines-tail
    35                              indentation space-before-tab
    35         space-before-tab indentation empty))
    36                              space-after-tab))
    36 
    37 
    37 ;; coding
    38 ;; coding
    38 (which-func-mode t)                                     ; show current function
    39 (which-func-mode t)                                     ; show current function
    39 (show-paren-mode t)                                     ; show matching paren
    40 (show-paren-mode t)                                     ; show matching paren
    40 (transient-mark-mode t)                                 ; show highlighting
    41 (transient-mark-mode t)                                 ; show highlighting
    42 (setq-default compile-command "scons ")                 ; compile command
    43 (setq-default compile-command "scons ")                 ; compile command
    43 (global-set-key (kbd "C-c c") 'compile)                 ; compile
    44 (global-set-key (kbd "C-c c") 'compile)                 ; compile
    44 (global-set-key (kbd "C-c r") 'recompile)               ; recompile
    45 (global-set-key (kbd "C-c r") 'recompile)               ; recompile
    45 (global-set-key (kbd "C-c C-c")                         ; comment
    46 (global-set-key (kbd "C-c C-c")                         ; comment
    46                 'comment-or-uncomment-region)
    47                 'comment-or-uncomment-region)
    47 
       
    48 ;; includes
       
    49 (require 'hoersten-pastebin-region) ; send selected text to pastebin
       
    50 (require 'hoersten-c-style)         ; load c specific lisp
       
    51 (require 'hide-lines)               ; hide lines based on regexp
       
    52 (require 'vala-mode)                ; vala programming language
       
    53 
       
    54 ;; Xrefactory
       
    55 ;; (setq load-path (cons "~/xref/emacs" load-path))
       
    56 ;; (setq exec-path (cons "~/xref" exec-path))
       
    57 ;; (load "xrefactory")
       
    58 
       
    59 ;; iedit mode
       
    60 (require 'iedit)                    ; interactive edit mode
       
    61 (define-key global-map (kbd "C-;") 'iedit-mode)
       
    62 
       
    63 ;; nav mode
       
    64 (add-to-list 'load-path "~/.emacs.d/nav/")
       
    65 (require 'nav)
       
    66 
       
    67 ;; unicode
       
    68 (require 'pretty-mode)
       
    69 (global-pretty-mode t)
       
    70 (setq haskell-font-lock-symbols 'unicode)
       
    71 
       
    72 ;; snippets
       
    73 (add-to-list 'load-path "~/.emacs.d/yasnippet/")
       
    74 (require 'yasnippet)
       
    75 (yas/initialize)
       
    76 (yas/load-directory "~/.emacs.d/yasnippet/snippets/")
       
    77 
       
    78 ;; zencoding html
       
    79 (require 'zencoding-mode)
       
    80 (add-hook 'sgml-mode-hook 'zencoding-mode) ; Auto-start on any markup modes
       
    81 
       
    82 ;; unique buffer names with dirs
       
    83 (require 'uniquify)
       
    84 (setq
       
    85  uniquify-buffer-name-style 'post-forward
       
    86  uniquify-separator ":")
       
    87 
       
    88 ;; terminal and shell
       
    89 (global-set-key (kbd "C-c t") '(lambda () (interactive) (ansi-term "bash" "term"))) ; start term
       
    90 (global-set-key (kbd "C-c s") 'shell) ; start shell - acts like emacs buffer
       
    91 (ansi-color-for-comint-mode-on)       ; color in shell buffer
       
    92 (setq-default
       
    93  comint-scroll-to-bottom-on-input t   ; only type on prompt
       
    94  comint-scroll-show-maximum-output t) ; place text at bottom
       
    95 
       
    96 ;; org mode
       
    97 (add-hook
       
    98  'org-mode-hook
       
    99  '(lambda ()
       
   100     (local-set-key (kbd "M-p") 'org-move-item-up)
       
   101     (local-set-key (kbd "M-S-p") 'org-move-subtree-up)
       
   102     (local-set-key (kbd "M-n") 'org-move-item-down)
       
   103     (local-set-key (kbd "M-S-n") 'org-move-subtree-down)))
       
   104 
    48 
   105 ;; line numbers
    49 ;; line numbers
   106 ;;(global-linum-mode t)
    50 ;;(global-linum-mode t)
   107 (mapc
    51 (mapc
   108  (lambda (x)
    52  (lambda (x)
   136       ;; twilight theme
    80       ;; twilight theme
   137       (require 'color-theme)
    81       (require 'color-theme)
   138       (load "color-theme-twilight")
    82       (load "color-theme-twilight")
   139       (color-theme-twilight)
    83       (color-theme-twilight)
   140       (global-hl-line-mode t)))
    84       (global-hl-line-mode t)))
       
    85 
       
    86 ;; terminal and shell
       
    87 (global-set-key (kbd "C-c t") '(lambda () (interactive) (ansi-term "bash" "term"))) ; start term
       
    88 (global-set-key (kbd "C-c s") 'shell) ; start shell - acts like emacs buffer
       
    89 (ansi-color-for-comint-mode-on)       ; color in shell buffer
       
    90 (setq-default
       
    91  comint-scroll-to-bottom-on-input t   ; only type on prompt
       
    92  comint-scroll-show-maximum-output t) ; place text at bottom
       
    93 
       
    94 ;;;;;;;;;;;;; includes & requires ;;;;;;;;;;;;;
       
    95 
       
    96 ;; includes
       
    97 (require 'hoersten-pastebin-region) ; send selected text to pastebin
       
    98 (require 'hoersten-c-style)         ; load c specific lisp
       
    99 (require 'hide-lines)               ; hide lines based on regexp
       
   100 (require 'vala-mode)                ; vala programming language
       
   101 
       
   102 ;; Xrefactory
       
   103 ;; (setq load-path (cons "~/xref/emacs" load-path))
       
   104 ;; (setq exec-path (cons "~/xref" exec-path))
       
   105 ;; (load "xrefactory")
       
   106 
       
   107 ;; iedit mode
       
   108 (require 'iedit)                    ; interactive edit mode
       
   109 (define-key global-map (kbd "C-;") 'iedit-mode)
       
   110 
       
   111 ;; nav mode
       
   112 (add-to-list 'load-path "~/.emacs.d/nav/")
       
   113 (require 'nav)
       
   114 
       
   115 ;; unicode
       
   116 (require 'pretty-mode)
       
   117 (global-pretty-mode t)
       
   118 (setq haskell-font-lock-symbols 'unicode)
       
   119 
       
   120 ;; snippets
       
   121 (add-to-list 'load-path "~/.emacs.d/yasnippet/")
       
   122 (require 'yasnippet)
       
   123 (yas/initialize)
       
   124 (yas/load-directory "~/.emacs.d/yasnippet/snippets/")
       
   125 
       
   126 ;; python mode
       
   127 (add-hook
       
   128  'python-mode-hook
       
   129  (lambda ()
       
   130    (setq
       
   131     tab-width 3
       
   132     python-indent 3
       
   133     indent-tabs-mode t)))
       
   134 
       
   135 ;; zencoding html
       
   136 (require 'zencoding-mode)
       
   137 (add-hook 'sgml-mode-hook 'zencoding-mode) ; Auto-start on any markup modes
       
   138 
       
   139 ;; unique buffer names with dirs
       
   140 (require 'uniquify)
       
   141 (setq
       
   142  uniquify-buffer-name-style 'post-forward
       
   143  uniquify-separator ":")
       
   144 
       
   145 ;; org mode
       
   146 (add-hook
       
   147  'org-mode-hook
       
   148  (lambda ()
       
   149    (local-set-key (kbd "M-p") 'org-move-item-up)
       
   150    (local-set-key (kbd "M-S-p") 'org-move-subtree-up)
       
   151    (local-set-key (kbd "M-n") 'org-move-item-down)
       
   152    (local-set-key (kbd "M-S-n") 'org-move-subtree-down)))