forked from shingonoide/emacs-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shingo.el
75 lines (57 loc) · 2.08 KB
/
shingo.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
; Colors
; http://www.cs.cmu.edu/~maverick/GNUEmacsColorThemeTest/
(load "color-theme-library")
(color-theme-lss)
; Re-read a buffer from disk
(global-set-key (kbd "<f5>") 'revert-buffer)
; Search tags
(global-set-key [(control tab)] 'find-tag)
; Indent with spaces
(setq-default indent-tabs-mode nil)
; Set current tabs to 2
(setq default-tab-width 4)
; Syntax highlight please
(global-font-lock-mode t)
; Spel check comments
(setq-default flyspell-prog-mode t)
; Magic Function to chmod +x anyfile that starts with a hashbang
; http://rubygarden.org/ruby?InstallingEmacsExtensions
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
; No scroll please
(scroll-bar-mode -1)
;; Always wordwrap
(setq truncate-partial-width-windows nil)
; no autofills please
(setq auto-fill-mode 0)
; format the title-bar to always include the buffer name
(setq frame-title-format (list "" "emacs" ": %f" ))
(setq auto-mode-alist (cons '("\\.mdwn$" . markdown-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.page$" . markdown-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.eml$" . markdown-mode) auto-mode-alist))
;; Tab completion
;; http://www.emacsblog.org/2007/03/12/tab-completion-everywhere/
(global-set-key [(tab)] 'smart-tab)
(defun smart-tab ()
"This smart tab is minibuffer compliant: it acts as usual in
the minibuffer. Else, if mark is active, indents region. Else if
point is at the end of a symbol, expands it. Else indents the
current line."
(interactive)
(if (minibufferp)
(unless (minibuffer-complete)
(dabbrev-expand nil))
(if mark-active
(indent-region (region-beginning)
(region-end))
(if (looking-at "\\_>")
(dabbrev-expand nil)
(indent-for-tab-command)))))
(add-to-list 'auto-mode-alist '("\\.liquid$" . nxhtml-mode))
(setenv "ESHELL" (expand-file-name "~/bin/eshell"))
;; geben debug
(add-to-list 'load-path "/Users/shingo/elisp/geben")
(add-to-list 'load-path "/Users/shingo/elisp/geben/gud")
;; shell-mode
(defun shell ()
(interactive)
(ansi-term "/bin/zsh"))