forked from lgxZJ/Miscellaneous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs
74 lines (58 loc) · 2.08 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
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(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.
'(package-selected-packages
(quote
(ac-etags dumb-jump auto-complete go-complete flymake-go company-go ztree))))
(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.
)
;; load emacs 24's package system. Add MELPA repository.
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list
'package-archives
;; '("melpa" . "http://stable.melpa.org/packages/") ; many packages won't show if using stable
'("melpa" . "http://melpa.milkbox.net/packages/")
t))
;; WindMove
(when (fboundp 'windmove-default-keybindings)
(windmove-default-keybindings))
;; WindMove key bindings
(global-set-key (kbd "C-c <left>") 'windmove-left)
(global-set-key (kbd "C-c <right>") 'windmove-right)
(global-set-key (kbd "C-c <up>") 'windmove-up)
(global-set-key (kbd "C-c <down>") 'windmove-down)
;; go-complete
(require 'go-complete)
(add-hook 'completion-at-point-functions 'go-complete-at-point)
;; auto-complete
(ac-config-default)
;; dumb-jump
(dumb-jump-mode)
;; ac-etags
(custom-set-variables
'(ac-eags-requires 1))
(eval-after-load "etags"
'(progn
(ac-etags-setup)))
(defun my/c-mode-common-hook ()
(add-to-list 'ac-sources 'ac-source-etags))
(add-hook 'c-mode-common-hook 'my/c-mode-common-hook)
;; key bindings
(global-set-key (kbd "M-,") 'godef-jump)
(global-set-key (kbd "M-.") 'pop-tag-mark)
;; ztree-dir
(setq ztree-dir-move-focus 't)
;; Which-Func-Mmode
(which-func-mode 1)