Cleaned up emacs.el quite a bit and added better unique file naming. Added capital greek letters in unicode.
authorLuke Hoersten <Luke@Hoersten.org>
Fri, 04 Dec 2009 22:38:21 -0600
changeset 13 7dc464c4e2d3
parent 12 272dd4613dd9
child 14 4fc155f601d6
Cleaned up emacs.el quite a bit and added better unique file naming. Added capital greek letters in unicode.
emacs.el
hoersten-c-style.el
pretty-mode.el
--- a/emacs.el	Fri Sep 25 09:16:25 2009 -0500
+++ b/emacs.el	Fri Dec 04 22:38:21 2009 -0600
@@ -11,50 +11,77 @@
 (put 'set-goal-column 'disabled nil)                                  ; enable goal column setting
 (put 'narrow-to-region 'disabled nil)                                 ; enable hiding
 
-(menu-bar-mode nil)                                                   ; remove menu bar in no-x mode
+(menu-bar-mode nil)                                                   ; remove menu bar
 (display-time-mode t)                                                 ; show clock
 (column-number-mode t)                                                ; show column numbers
 (delete-selection-mode t)                                             ; replace highlighted text
 (windmove-default-keybindings)                                        ; move between windows with shift-arrow
 (setq-default indent-tabs-mode nil)                                   ; mouse hover variables
+(ido-mode t)                                                          ; file/buffer selector
+(setq-default ido-enable-flex-matching t)                             ; fuzzy matching for ido mode
+(add-hook 'text-mode-hook 'flyspell-mode t)                           ; spellcheck text
 
-(ido-mode t)                                                          ; file/buffer selector
-(setq-default ido-enable-flex-matching t)                             ; fuzzy matching is a must have
-(add-hook 'text-mode-hook 'flyspell-mode t)                           ; spellcheck text
+;; whitespace
+(global-whitespace-mode t)                                            ; show whitespace
+(add-hook 'before-save-hook 'whitespace-cleanup)                      ; cleanup whitespace on exit
+(setq-default whitespace-line-column 120)                             ; column width
+(setq-default whitespace-style
+              '(tabs tab-mark trailing lines-tail
+                     space-before-tab indentation empty))             ; what whitespace elements to show
 
 ;; coding
 (which-func-mode t)                                                   ; show current function
 (show-paren-mode t)                                                   ; show matching paren
 (transient-mark-mode t)                                               ; show highlighting
 (global-font-lock-mode t)                                             ; syntax highlighting
-(global-whitespace-mode t)                                            ; show whitespace
-(global-linum-mode t)
-(add-hook 'before-save-hook 'whitespace-cleanup)                      ; cleanup whitespace on exit
 (global-set-key (kbd "C-c c") 'compile)                               ; compile
 (global-set-key (kbd "C-c r") 'recompile)                             ; recompile
-(setq-default whitespace-line-column 120)                             ; column width
-(setq-default whitespace-style
-              '(tabs tab-mark trailing lines-tail
-                     space-before-tab indentation empty))             ; what whitespace elements to show
 
+;; includes
 (require 'hoersten-pastebin-region)                                   ; send selected text to pastebin
 (require 'mercurial)                                                  ; load mercurial mode
 (require 'nav)                                                        ; load nav bar
 (require 'hoersten-c-style)                                           ; load c specific lisp
 
-(require 'pretty-mode)                                                ; convert characters to unicode
+;; unicode
+(require 'pretty-mode)
 (global-pretty-mode t)
 (setq haskell-font-lock-symbols 'unicode)
 
+;; snippets
 (require 'yasnippet)
 (yas/initialize)
 (yas/load-directory "~/.emacs.d/snippets/")
 
-;; gdb settings
-(setq-default gdb-many-windows t)                                     ; gdb many windows
-(setq-default gdb-use-separate-io-buffer t)                           ; gdb stdio output
-(setq-default gud-tooltip-mode t)                                     ; mouse hover variables
-(global-set-key (kbd "C-c g") 'gdb)                                   ; gdb
+;; shell
+(global-set-key (kbd "C-c s") 'shell)              ; start shell
+(ansi-color-for-comint-mode-on)                    ; color in shell buffer
+(setq-default comint-scroll-to-bottom-on-input t)  ; only type on prompt
+(setq-default comint-scroll-show-maximum-output t) ; place text at bottom
+
+;; org mode
+(add-hook 'org-mode-hook
+          '(lambda ()
+             (local-set-key (kbd "M-p") 'org-move-item-up)
+             (local-set-key (kbd "M-S-p") 'org-move-subtree-up)
+             (local-set-key (kbd "M-n") 'org-move-item-down)
+             (local-set-key (kbd "M-S-n") 'org-move-subtree-down)))
+
+;; unique buffer names with dirs
+(require 'uniquify)
+(setq
+ uniquify-buffer-name-style 'post-forward
+ uniquify-separator ":")
+
+;; line numbers
+;;(global-linum-mode t)
+(mapc (lambda (x)
+        (add-hook x 'linum-mode))
+      '(text-mode-hook
+        c-mode-common-hook
+        python-mode-hook
+        haskell-mode-hook
+        emacs-lisp-mode-hook))
 
 ;; use only spaces for alignment
 (global-set-key (kbd "C-c a") 'align-with-spaces) ; align
@@ -68,30 +95,16 @@
     (indent-region beg end)
     (whitespace-cleanup-region beg end)))
 
-;; Shell
-(global-set-key (kbd "C-c s") 'shell)              ; start shell
-(ansi-color-for-comint-mode-on)                    ; color in shell buffer
-(setq-default comint-scroll-to-bottom-on-input t)  ; only type on prompt
-(setq-default comint-scroll-show-maximum-output t) ; place text at bottom
+;; x stuff
+(if window-system
+    (progn
+      (tool-bar-mode nil)   ; remove tool bar
+      (scroll-bar-mode nil) ; remove scroll bar
+      (visual-line-mode t)  ; word wrap break on whitespace
+      (set-default-font "Monospace-10")
 
-;; map file extensions to modes
-(setq-default auto-mode-alist
-              (append
-               '(("\\.ipp$" . c++-mode)
-                 ("\\.inl$" . c++-mode)
-                 ("SCons"   . python-mode)
-                 ("\\.jj$"  . java-mode))
-               auto-mode-alist))
-
-;; x stuff
-(if (not window-system) nil
-  (tool-bar-mode nil)   ; remove tool bar
-  (scroll-bar-mode nil) ; remove scroll bar
-  (visual-line-mode t)  ; word wrap break on whitespace
-  (set-default-font "Monospace-10")
-
-  ;; twilight theme
-  (require 'color-theme)
-  (load "color-theme-twilight")
-  (color-theme-twilight)
-  (global-hl-line-mode t))
+      ;; twilight theme
+      (require 'color-theme)
+      (load "color-theme-twilight")
+      (color-theme-twilight)
+      (global-hl-line-mode t)))
--- a/hoersten-c-style.el	Fri Sep 25 09:16:25 2009 -0500
+++ b/hoersten-c-style.el	Fri Dec 04 22:38:21 2009 -0600
@@ -55,8 +55,17 @@
             (local-set-key (kbd "<f2>")  'hs-show-all)
             (hs-minor-mode t)                                    ; enable hide-show mode
 
+            ;; gdb settings
+            (setq gdb-many-windows t)                            ; gdb many windows
+            (setq gdb-use-separate-io-buffer t)                  ; gdb stdio output
+            (setq gud-tooltip-mode t)                            ; mouse hover variables
+            (local-set-key (kbd "C-c g") 'gdb)                   ; gdb
+
             ;; auto-close bracing
             (dolist (key '("(" "[")) (define-key (current-local-map) key 'insert-pair))
             ))
 
+(add-to-list 'auto-mode-alist '("\\.ipp$" . c++-mode))
+(add-to-list 'auto-mode-alist '("\\.inl$" . c++-mode))
+
 (provide 'hoersten-c-style)
\ No newline at end of file
--- a/pretty-mode.el	Fri Sep 25 09:16:25 2009 -0500
+++ b/pretty-mode.el	Fri Dec 04 22:38:21 2009 -0600
@@ -148,41 +148,87 @@
        (?→ ("->" ,@mley ess c c++ perl))
        (?↑ ("\\^" tuareg))
        (?⇒ ("=>" sml perl ruby))
-;;;        (?∅ ("nil" emacs-lisp ruby)
-;;;            ("null" scheme java)
-;;;            ("NULL" c c++)
-;;;            ("None" python)
-;;;            ("()" ,@mley))
        (?≡ ("==" ,@c-like erlang haskell))
        (?∀ ("BOOST_FOREACH" c++))
        (?∷ ("::" ,@all))
        (?√ ("sqrt" ,@all))
        (?∑ ("sum" python))
+
        (?α ("alpha" ,@all))
+       (?Α ("Alpha" ,@all))
+
        (?β ("beta" ,@all))
+       (?Β ("Beta" ,@all))
+
        (?γ ("gamma" ,@all))
+       (?Γ ("Gamma" ,@all))
+
        (?δ ("delta" ,@all))
+       (?Δ ("Delta" ,@all))
+
        (?ε ("epsilon" ,@all))
+       (?Ε ("epsilon" ,@all))
+
        (?ζ ("zeta" ,@all))
+       (?Ζ ("Zeta" ,@all))
+
        (?η ("eta" ,@all))
+       (?Η ("Eta" ,@all))
+
        (?θ ("theta" ,@all))
+       (?Θ ("Theta" ,@all))
+
        (?ι ("iota" ,@all))
+       (?Ι ("Iota" ,@all))
+
        (?κ ("kappa" ,@all))
+       (?K ("Kappa" ,@all))
+
        (?λ ("lambda" ,@all))
+       (?Λ ("Lambda" ,@all))
+
        (?μ ("mu" ,@all))
+       (?Μ ("Mu" ,@all))
+
        (?ν ("nu" ,@all))
+       (?Ν ("Nu" ,@all))
+
        (?ν ("vega" ,@all))
+       (?ν ("Vega" ,@all))
+
        (?ξ ("xi" ,@all))
+       (?Ξ ("Xi" ,@all))
+
        (?ο ("omicron" ,@all))
+       (?Ο ("Omicron" ,@all))
+
        (?π ("pi" ,@all))
+       (?Π ("pi" ,@all))
+
        (?ρ ("rho" ,@all))
+       (?Ρ ("Rho" ,@all))
+
        (?σ ("sigma" ,@all))
+       (?Σ ("Sigma" ,@all))
+
        (?τ ("tau" ,@all))
+       (?Τ ("Tau" ,@all))
+
        (?υ ("upsilon" ,@all))
+       (?Y ("Upsilon" ,@all))
+
        (?φ ("phi" ,@all))
+       (?Φ ("Phi" ,@all))
+
        (?χ ("chi" ,@all))
+       (?Χ ("Chi" ,@all))
+
        (?ψ ("psi" ,@all))
+       (?Ψ ("Psi" ,@all))
+
        (?ω ("omega" ,@all))
+       (?Ω ("Omega" ,@all))
+
        (?² ("**2" python tuareg octave))
        (?³ ("**3" python tuareg octave))
        (?ⁿ ("**n" python tuareg octave))