forked from technomancy/emacs-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fdelacruz.el
104 lines (84 loc) · 3.19 KB
/
fdelacruz.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
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
;; DESCRIPTION: fdelacruz settings
(add-to-list 'load-path dotfiles-dir)
;; Don't make backup~ files
(setq make-backup-files nil)
;; Color-theme ONLY when in Emacs.app
(when window-system
(add-to-list 'load-path (concat dotfiles-dir "/vendor/color-theme/"))
(require 'color-theme)
(color-theme-initialize)
(color-theme-dark-laptop))
;; Snippets
(add-to-list 'load-path (concat dotfiles-dir "/vendor/yasnippet"))
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/vendor/yasnippet/snippets")
;; Scala-mode
(add-to-list 'load-path (concat dotfiles-dir "/vendor/scala-mode"))
(require 'scala-mode-auto)
(setq yas/my-directory "~/.emacs.d/vendor/scala-mode/contrib/yasnippet/snippets")
(yas/load-directory yas/my-directory)
(add-hook 'scala-mode-hook
'(lambda ()
(yas/minor-mode-on)))
;; Org-mode
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(global-font-lock-mode 1) ; for all buffers
(add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
;; Tramp-mode
(setq tramp-default-method "ssh")
;; Invoke M-x without the Alt key
(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
;; M-x compile for cpp files
(add-hook 'c++-mode-hook
(lambda ()
(unless (file-exists-p "Makefile")
(set (make-local-variable 'compile-command)
(let ((file (file-name-nondirectory buffer-file-name)))
(format "%s -o %s %s %s"
(or (getenv "CC") "g++")
(file-name-sans-extension file)
(or (getenv "CFLAGS") "-Wall -gstabs")
file))))))
;; M-x compile for java files
(add-hook 'java-mode-hook
(lambda ()
(unless (file-exists-p "Makefile")
(set (make-local-variable 'compile-command)
(let ((file (file-name-nondirectory buffer-file-name)))
(format "%s %s"
(or "javac")
file))))))
;; Macros
(fset 'TiJ4CodeFix
(lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("version1.56version1.56J2SE5f61.5ff6" 0 "%d")) arg)))
;; nXhtml (beta 2.09, revision 834)
(add-hook 'html-mode-hook (lambda ()
(progn
(load-file "~/.emacs.d/vendor/~nxhtml/nxhtml/main/autostart.el")
)))
;; Auto-Complete-mode
(add-to-list 'load-path (concat dotfiles-dir "/vendor/auto-complete"))
(require 'auto-complete-config)
(ac-config-default)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/vendor/auto-complete/ac-dict")
;; python-mode.el
(add-to-list 'load-path (concat dotfiles-dir "/vendor/python-mode.el"))
(setq py-install-directory "~/.emacs.d/vendor/python-mode.el")
(require 'python-mode)
;; flymake-python-pycheckers.el
(add-hook 'python-mode-hook (lambda ()
(progn
(load-file "~/.emacs.d/flymake-python-pycheckers.el")
)))
;; Magit
(add-to-list 'load-path (concat dotfiles-dir "/vendor/magit"))
(require 'magit)