emacs.el
changeset 1 ede059431d20
parent 0 c25fee3c92e9
child 2 0c29010a8c83
equal deleted inserted replaced
0:c25fee3c92e9 1:ede059431d20
    39 (global-set-key (kbd "C-c g") 'gdb)                                   ; gdb
    39 (global-set-key (kbd "C-c g") 'gdb)                                   ; gdb
    40 
    40 
    41 ;; haskell
    41 ;; haskell
    42 (setq haskell-font-lock-symbols 'unicode)
    42 (setq haskell-font-lock-symbols 'unicode)
    43 
    43 
    44 ;; indentation
       
    45 (setq-default tab-width 3)
       
    46 (setq-default c-basic-offset 3)
       
    47 (setq-default indent-tabs-mode t)
       
    48 
       
    49 ;; use only spaces for alignment
    44 ;; use only spaces for alignment
    50 (global-set-key (kbd "C-c a") 'align-with-spaces)  ; align
    45 (global-set-key (kbd "C-c a") 'align-with-spaces)  ; align
    51 (defun align-with-spaces (beg end)
    46 (defun align-with-spaces (beg end pattern)
    52   "Align selected using only spaces for whitespace."
    47   "Align selected using only spaces for whitespace."
    53   (interactive "r")
    48   (interactive "r\nsAlign by: ")
    54   (let ((indent-tabs-mode nil))
    49   (let ((indent-tabs-mode nil))
    55 	 (align beg end)))
    50     (align-string beg end pattern 1)
       
    51     (align-entire beg end)
       
    52     (untabify beg end)
       
    53     (indent-region beg end)
       
    54     (whitespace-cleanup-region beg end)))
    56 
    55 
    57 ;; shell
    56 ;; Shell
    58 (global-set-key (kbd "C-c s") 'shell)              ; start shell
    57 (global-set-key (kbd "C-c s") 'shell)              ; start shell
    59 (ansi-color-for-comint-mode-on)                    ; color in shell buffer
    58 (ansi-color-for-comint-mode-on)                    ; color in shell buffer
    60 (setq-default comint-scroll-to-bottom-on-input t)  ; only type on prompt
    59 (setq-default comint-scroll-to-bottom-on-input t)  ; only type on prompt
    61 (setq-default comint-scroll-show-maximum-output t) ; place text at bottom
    60 (setq-default comint-scroll-show-maximum-output t) ; place text at bottom
    62 
    61 
    63 ;; map file extensions to modes
    62 ;; map file extensions to modes
    64 (setq-default auto-mode-alist
    63 (setq-default auto-mode-alist
    65 				  (append
    64 	      (append
    66 					'(("\\.ipp$" . c++-mode)
    65 	       '(("\\.ipp$" . c++-mode)
    67 					  ("\\.inl$" . c++-mode)
    66 		 ("\\.inl$" . c++-mode)
    68 					  ("SCons"   . python-mode)
    67 		 ("SCons"   . python-mode)
    69 					  ("\\.jj$"  . java-mode))
    68 		 ("\\.jj$"  . java-mode))
    70 					auto-mode-alist))
    69 	       auto-mode-alist))
    71 
    70 
    72 ;; x stuff
    71 ;; x stuff
    73 (if (not window-system)
    72 (if (not window-system)
    74 	 (menu-bar-mode nil)                      ; remove menu bar in no-x mode
    73     (menu-bar-mode nil) ; remove menu bar in no-x mode
    75   (tool-bar-mode nil)                        ; remove tool bar
    74   (tool-bar-mode nil)   ; remove tool bar
    76   (scroll-bar-mode nil)                      ; remove scroll bar
    75   (scroll-bar-mode nil) ; remove scroll bar
    77   (custom-set-faces '(default ((t (:background "#000000" :foreground "#ffffff" :height 100 :family "DejaVu Sans Mono")))))
    76   (custom-set-faces '(default ((t (:background "#000000" :foreground "#ffffff" :height 100 :family "DejaVu Sans Mono")))))
    78   (setq default-frame-alist '((width . 100) (height . 50) (menu-bar-lines . 1)))
    77   (setq default-frame-alist '((width . 100) (height . 50) (menu-bar-lines . 1)))
    79 
    78 
    80   ;; twilight theme
    79   ;; twilight theme
    81   (require 'color-theme)
    80   (require 'color-theme)