-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.emacs
77 lines (66 loc) · 2.41 KB
/
.emacs
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
76
77
;; indentation
(setq c-default-style "stroustrup")
(setq tab-stop-list (number-sequence 4 200 4))
;;(setq-default tab-width 4)
(setq c-basic-offset 4)
(setq sgml-basic-offset 4)
(setq-default indent-tabs-mode nil)
;; no backup
(setq make-backup-files nil)
;; minibuffer color
;(set-face-foreground 'minibuffer-prompt "white")
;; php mode
;;(add-to-list 'load-path "~/.elisp/")
;;(load "php-mode")
;;(add-to-list 'auto-mode-alist
;; '("\\.php[34]?\\'\\|\\.phtml\\'" . php-mode))
;; indent region as
;;(defun indent-region-as (other-mode)
;; (interactive "aMode to use: ")
;; (save-excursion
;;(let ((old-mode major-mode))
;; (narrow-to-region (region-beginning) (region-end))
;; (funcall other-mode)
;; (indent-region (region-beginning) (region-end) nil)
;; (funcall old-mode)))
;; (widen))
;; octave mode
(autoload 'octave-mode "octave-mod" nil t)
(setq auto-mode-alist
(cons '("\\.m$" . octave-mode) auto-mode-alist))
;; line numbers
;(global-linum-mode 1)
;(setq linum-format
;(lambda (line)
;(propertize
;(format
;(let ((w (length
;(number-to-string
;(count-lines (point-min) (point-max))))))
;(concat " %"
;(number-to-string w) "d ")) line) 'face 'linum)))
;; solarized-dark color theme
;(require 'color-theme-solarized)
;(color-theme-solarized-dark)
;; highlight trailing whitespaces, tabs, and beyond 80 column lines ;;;;;;;;;;;
(custom-set-faces
'(my-tab-face ((((class color)) (:background "grey10"))) t)
'(my-trailing-space-face ((((class color)) (:background "gray10"))) t)
'(my-long-line-face ((((class color)) (:background "gray10"))) t))
(add-hook 'font-lock-mode-hook
(function
(lambda ()
(setq font-lock-keywords
(append font-lock-keywords
'(("\t+" (0 'my-tab-face t))
("^.\\{80,\\}$"(0 'my-long-line-face t))
("[ \t]+$" (0 'my-trailing-space-face t))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; cursor color
(set-cursor-color "#aaaaaa")
;; get font face under cursor pos
(defun what-face (pos)
(interactive "d")
(let ((face (or (get-char-property (point) 'read-face-name)
(get-char-property (point) 'face))))
(if face (message "Face: %s" face) (message "No face at %d" pos))))