forked from rigtorp/dotemacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
108 lines (93 loc) · 2.94 KB
/
init.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
101
102
103
104
105
106
107
108
;; basic settings
(set-default-font "Monospace-10")
(menu-bar-mode nil)
(scroll-bar-mode nil)
(tool-bar-mode nil)
(setq inhibit-startup-screen t)
(add-to-list 'load-path "~/.emacs.d/")
;; iflipb
(require 'iflipb)
(global-set-key (kbd "<C-right>") 'iflipb-next-buffer)
(global-set-key (kbd "<C-left>") 'iflipb-previous-buffer)
;; flyspell
(dolist (hook '(text-mode-hook))
(add-hook hook (lambda () (flyspell-mode 1))))
;; yasnippet
(add-to-list 'load-path "~/.emacs.d/yasnippet")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/yasnippet/snippets")
;; auto complete
(add-to-list 'load-path "~/.emacs.d/auto-complete")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories
"~/.emacs.d/auto-complete/ac-dict")
(ac-config-default)
;; gccsense
(require 'gccsense)
(add-hook 'c-mode-common-hook
(lambda ()
(local-set-key (kbd "C-c .") 'ac-complete-gccsense)))
;; gtags
;(add-hook 'c-mode-common-hook
; (lambda ()
; (gtags-mode)))
;; anything
(add-to-list 'load-path "~/.emacs.d/anything")
(require 'anything)
(require 'anything-config)
(require 'anything-git)
(defun anything-default ()
(interactive)
(setq anything-default-directory default-directory)
(anything-other-buffer
'(anything-c-source-buffers
anything-c-source-recentf
anything-c-source-files-in-current-dir
anything-c-source-git-files
anything-c-source-man-pages
anything-c-source-locate
anything-c-source-emacs-commands
anything-c-source-calculation-result)
nil))
(defun anything-for-current-buffer ()
(interactive)
(setq anything-default-directory default-directory)
(anything-other-buffer
'(anything-c-source-occur
anything-c-source-fixme
anything-c-source-imenu
anything-c-source-ctags)
"*anything current buffer*"))
(defun anything-for-current-project ()
(interactive)
(setq anything-default-directory default-directory)
(anything-other-buffer
'(anything-c-source-git-grep
anything-c-source-ctags)
"*anything current project*"))
(global-set-key (kbd "C-x C-a") 'anything-default)
(global-set-key (kbd "C-x C-b") 'anything-for-current-buffer)
(global-set-key (kbd "C-x p") 'anything-for-current-project)
;; c-mode
(c-set-offset 'innamespace 0)
;; custom
(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.
'(column-number-mode t)
'(ido-mode t nil (ido))
'(indent-tabs-mode nil)
'(recentf-mode t)
'(savehist-mode t nil (savehist))
'(show-paren-mode t)
'(standard-indent 2)
'(use-file-dialog nil))
(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.
)