src.nth.io/

summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2010-09-28 17:03:53 -0500
committerLuke Hoersten <[email protected]>2010-09-28 17:03:53 -0500
commit27db253053e412858f621fcda0e46bcc89b75676 (patch)
tree9c04ad910ba76507a60ab04524490b559ef0e9aa /init.el
parent43c8b735aa076d15d3af8789e92f9e03f0d10226 (diff)
Rearrainged init.el
Diffstat (limited to 'init.el')
-rw-r--r--init.el120
1 files changed, 66 insertions, 54 deletions
diff --git a/init.el b/init.el
index 5ac6840..efec05b 100644
--- a/init.el
+++ b/init.el
@@ -9,11 +9,12 @@
x-select-enable-clipboard t ; paste from X buffer
inhibit-splash-screen t ; disable splash screen
truncate-lines t ; truncate, not wrap, lines
- indent-tabs-mode nil ; mouse hover variables
+ indent-tabs-mode nil ; only uses spaces for indentation
split-width-threshold 181) ; min width to split window horizontially
(put 'set-goal-column 'disabled nil) ; enable goal column setting
(put 'narrow-to-region 'disabled nil) ; enable hiding
+(put 'narrow-to-page 'disabled nil)
(menu-bar-mode nil) ; remove menu bar
(display-time-mode t) ; show clock
@@ -30,9 +31,9 @@
(add-hook 'before-save-hook 'whitespace-cleanup) ; cleanup whitespace on exit
(setq-default
whitespace-line-column 120 ; column width
- whitespace-style ; whitespace elements to show
- '(tabs tab-mark trailing lines-tail
- space-before-tab indentation empty))
+ whitespace-style '(trailing lines-tail empty
+ indentation space-before-tab
+ space-after-tab))
;; coding
(which-func-mode t) ; show current function
@@ -45,6 +46,53 @@
(global-set-key (kbd "C-c C-c") ; comment
'comment-or-uncomment-region)
+;; 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)
+(defun align-with-spaces (beg end pattern)
+ "Align selected using only spaces for whitespace."
+ (interactive "r\nsAlign by: ")
+ (let ((indent-tabs-mode nil))
+ (align-string beg end pattern 1)
+ (align-entire beg end)
+ (untabify beg end)
+ (indent-region beg end)
+ (whitespace-cleanup-region beg end)))
+
+;; 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")
+
+ ;; twilight theme
+ (require 'color-theme)
+ (load "color-theme-twilight")
+ (color-theme-twilight)
+ (global-hl-line-mode t)))
+
+;; terminal and shell
+(global-set-key (kbd "C-c t") '(lambda () (interactive) (ansi-term "bash" "term"))) ; start term
+(global-set-key (kbd "C-c s") 'shell) ; start shell - acts like emacs buffer
+(ansi-color-for-comint-mode-on) ; color in shell buffer
+(setq-default
+ comint-scroll-to-bottom-on-input t ; only type on prompt
+ comint-scroll-show-maximum-output t) ; place text at bottom
+
+;;;;;;;;;;;;; includes & requires ;;;;;;;;;;;;;
+
;; includes
(require 'hoersten-pastebin-region) ; send selected text to pastebin
(require 'hoersten-c-style) ; load c specific lisp
@@ -75,6 +123,15 @@
(yas/initialize)
(yas/load-directory "~/.emacs.d/yasnippet/snippets/")
+;; python mode
+(add-hook
+ 'python-mode-hook
+ (lambda ()
+ (setq
+ tab-width 3
+ python-indent 3
+ indent-tabs-mode t)))
+
;; zencoding html
(require 'zencoding-mode)
(add-hook 'sgml-mode-hook 'zencoding-mode) ; Auto-start on any markup modes
@@ -85,56 +142,11 @@
uniquify-buffer-name-style 'post-forward
uniquify-separator ":")
-;; terminal and shell
-(global-set-key (kbd "C-c t") '(lambda () (interactive) (ansi-term "bash" "term"))) ; start term
-(global-set-key (kbd "C-c s") 'shell) ; start shell - acts like emacs buffer
-(ansi-color-for-comint-mode-on) ; color in shell buffer
-(setq-default
- comint-scroll-to-bottom-on-input t ; only type on prompt
- 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)))
-
-;; 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)
-(defun align-with-spaces (beg end pattern)
- "Align selected using only spaces for whitespace."
- (interactive "r\nsAlign by: ")
- (let ((indent-tabs-mode nil))
- (align-string beg end pattern 1)
- (align-entire beg end)
- (untabify beg end)
- (indent-region beg end)
- (whitespace-cleanup-region beg end)))
-
-;; 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")
-
- ;; twilight theme
- (require 'color-theme)
- (load "color-theme-twilight")
- (color-theme-twilight)
- (global-hl-line-mode t)))
+ (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)))