-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs
135 lines (107 loc) · 4.49 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
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
(add-to-list 'load-path "~/.emacs.d/")
(defun indent-buffer ()
"Indents an entire buffer using the default intenting scheme."
(interactive)
(save-excursion
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max))))
(global-set-key "\C-x\\" 'indent-buffer)
(tool-bar-mode -1)
(menu-bar-mode -1)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)
(require 'auto-complete)
(show-paren-mode)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(font-lock-comment-face ((((class color) (min-colors 88) (background dark)) (:foreground "blue4"))))
'(font-lock-function-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "spring green"))))
'(font-lock-keyword-face ((((class color) (min-colors 88) (background dark)) (:foreground "purple2"))))
'(font-lock-string-face ((((class color) (min-colors 88) (background dark)) (:foreground "red3")))))
;; PYTHON IDE
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default py-indent-offset 4)
(require 'python-mode)
(add-hook 'python-mode-hook 'linum-mode t)
(autoload 'python-mode "python-mode" "Python Mode." t)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("ipython" . python-mode))
(setq ipython-command "/usr/bin/ipython")
(setq py-python-command-args '("-pylab" "-colors" "LightBG"))
(require 'ipython)
(require 'anything)
(require 'anything-ipython)
(when (require 'anything-show-completion nil t) (use-anything-show-completion 'anything-ipython-complete '(length initial-pattern)))
(require 'comint)
(define-key comint-mode-map (kbd "M-") 'comint-next-input)
(define-key comint-mode-map (kbd "M-") 'comint-previous-input)
(define-key comint-mode-map [down] 'comint-next-matching-input-from-input)
(define-key comint-mode-map [up] 'comint-previous-matching-input-from-input)
(require 'python-pep8)
(require 'python-pylint)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(defun annotate-pdb ()
(interactive)
(highlight-lines-matching-regexp "import pdb")
(highlight-lines-matching-regexp "pdb.set_trace()"))
(add-hook 'python-mode-hook 'annotate-pdb)
(defun python-add-breakpoint ()
(interactive)
(py-newline-and-indent)
(insert "import ipdb; ipdb.set_trace()")
(highlight-lines-matching-regexp "^[ ]*import ipdb; ipdb.set_trace()"))
(define-key py-mode-map (kbd "C-c C-t") 'python-add-breakpoint)
;; GENERAL (again)
(delete-selection-mode)
(require 'aris)
(require 'multi-term)
(multi-term-keystroke-setup)
;;(setq multi-term-program "bin/bash")
(set-background-color "black")
(set-foreground-color "white")
;;;PHP
(autoload 'php-mode "php-mode" "Major mode for editing php code." t)
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(add-to-list 'auto-mode-alist '("\\.inc$" . php-mode))
;;;JAVASCRIPT
(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
(autoload 'javascript-mode "javascript" nil t)
(add-to-list 'ac-css-value-classes
'(border-width "thin" "medium" "thick" "inherit"))
(set-cursor-color "white")
(defun green-ansi-term ()
"Show an existing buffer called \"*ansi-term*\" if one exists, otherwise
call function ansi-term interactively."
(interactive)
(let ((existing-buffer (get-buffer "*ansi-term*")))
(if existing-buffer
(switch-to-buffer existing-buffer)
(call-interactively 'ansi-term))))
(global-set-key (kbd "\C-x \C-a") 'green-ansi-term)
(setq erc-log-channels-directory "~/.erc/logs/")
(setq erc-save-buffer-on-part nil
erc-save-queries-on-quit nil
erc-log-write-after-send t
erc-log-write-after-insert t)
(setq erc-hide-timestamps t)
(defadvice save-buffers-kill-emacs (before save-logs (arg) activate)
(save-some-buffers t (lambda () (when (and (eq major-mode 'erc-mode)
(not (null buffer-file-name)))))))
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq term-default-bg-color "black")
(setq term-default-fg-color "white")
(global-set-key (kbd "C->") 'end-of-line)
(server-start)