summaryrefslogtreecommitdiff
path: root/.emacs
blob: 55bdb90e5aa381a3bab9ca2953e9c263de466f41 (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
(set-face-attribute 'default nil :height 80)

(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)

(defun load-identica-mode ()
  (when (require 'netrc nil t)
    (autoload 'identica-mode "identica-mode" nil t)
    (let ((identica (netrc-machine (netrc-parse "~/.netrc") "identi.ca" t)))
      (setq identica-password (netrc-get identica "password"))
      (setq identica-username (netrc-get identica "login"))
    )
  )
)

(setq package-archives '(("ELPA" . "http://tromey.com/elpa/")
                         ("marmalade" . "http://marmalade-repo.org/packages/")
                         ("gnu" . "http://elpa.gnu.org/packages/")))

(add-to-list 'load-path "~/.emacs.d/")
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(require 'el-get)
(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-recipes")
(setq el-get-sources
      '(el-get
        package
        rainbow-delimiters
        php-mode-improved
	mmm-mode
        dtrt-indent
	folding
        apel flim semi wanderlust
        (:name color-theme
               :after (lambda ()
                        (color-theme-tty-dark)))
        (:name color-theme-solarized
               :after (lambda ()
                        (add-hook 'after-make-frame-functions
                                  (lambda (frame)
                                    (set-variable 'color-theme-is-global nil)
                                    (select-frame frame)
                                    (if window-system
                                        (color-theme-solarized-dark)
                                        (color-theme-tty-dark))))))
        (:name org-mode
               :url "git://orgmode.org/org-mode.git"
               :features org-install
               :after (lambda ()
                        (require 'org-checklist)
                        (setq org-hide-leading-stars t)
                        (setq org-log-done 'time)))
        (:name identica-mode
               :after (lambda ()
                        (load-identica-mode)))
        (:name smarttabs
               :url "git://gist.github.com/896190.git")
        (:name autopair
               :after (lambda ()
                        (autopair-global-mode 1)
                        (setq autopair-autowrap t)))
        ))
(el-get)

(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'after-make-frame-functions
          (lambda (frame)
            (set-variable 'term-default-fg-color
                          (face-foreground 'default))
            (set-variable 'term-default-bg-color
                          (face-background 'default)))
          t)

(load "emacsutils")

(tool-bar-mode -1)
(ido-mode t)
(show-paren-mode 1)

(defun toggle-fullscreen (&optional f)
  (interactive)
  (let ((current-value (frame-parameter nil 'fullscreen)))
    (set-frame-parameter nil 'fullscreen
                         (if (equal 'fullboth current-value)
                             (if (boundp 'old-fullscreen) old-fullscreen nil)
                           (progn (setq old-fullscreen current-value)
                                  'fullboth)))))
(global-set-key [f11] 'toggle-fullscreen)

(load "whitespace")
(global-set-key "\C-cw" 'global-whitespace-mode)
(setq whitespace-style '(
;  face
;  tabs
  tab-mark
;  spaces
  space-mark
;  newline
  newline-mark
  empty
))

;; These are my preferred settings; we let dtrt-indent detect when we play with other's files
(setq-default tab-width 8)
(setq-default c-basic-offset 8)
(setq-default indent-tabs-mode t)


(setq
 backup-by-copying	t ;; don't clobber symlinks
 backup-directory-alist	'(("." . "~/.saves")) ;; don't litter my fs tree
 delete-old-versions	t
 kept-new-versions	6
 kept-old-versions	2
 version-control	t ;; use versioned backups
)

(setq column-number-mode t
      inhibit-startup-screen t
      line-number-mode t
      server-use-tcp t
      server-mode t
      show-paren-mode t)

(setq browse-url-generic-program (executable-find "v-www-browser")
      browse-url-browser-function 'browse-url-generic)

(add-hook 'term-mode-hook
	  #'(lambda () (setq autopair-dont-activate t)))

;(require 'flymake)
;(add-hook 'php-mode-hook (lambda() (flymake-mode 1)))
;(define-key php-mode-map '[M-S-up] 'flymake-goto-prev-error)
;(define-key php-mode-map '[M-S-down] 'flymake-goto-next-error)

;(setq tramp-debug-buffer t) 
;(setq tramp-verbose 10)