-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
150 lines (119 loc) · 4.38 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
(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)
'(inhibit-startup-screen t)
'(show-paren-mode t)
'(tool-bar-mode 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.
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; elpa
(require 'package)
(add-to-list 'package-archives
'("Marmalade" . "http://marmalade-repo.org/packages/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")))
(package-initialize)
;; tab and space
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
;;(setq-default lua-indent-level 4)
;; coding utf8
(setq revert-buffer-with-coding-system 'utf-8)
;; scroll single line
(setq scroll-step 1 scroll-conservatively 10000)
;; hs-minor-model
(when (eq system-type 'gnu/linux)
;; linum
(setq linum-format "%3d ")
;; backspace ctrl + h
(global-set-key "\C-h" 'backward-delete-char-untabify)
(global-set-key "\d" 'delete-char)
;; (setq make-backup-files nil)
(setq backup-directory-alist (quote (("." . "/tmp/emacs"))))
;; 中文符号 乱码
(set-language-environment 'Chinese-GB)
;;(set-keyboard-coding-system 'utf-8)
;;(set-clipboard-coding-system 'utf-8)
;;(set-terminal-coding-system 'utf-8)
;;(set-buffer-file-coding-system 'utf-8)
;;(set-default-coding-systems 'utf-8)
;;(set-selection-coding-system 'utf-8)
;;(modify-coding-system-alist 'process "*" 'utf-8)
;;(setq default-process-coding-system '(utf-8 . utf-8))
;;(setq-default pathname-coding-system 'utf-8)
;;(set-file-name-coding-system 'utf-8)
)
(when (eq system-type 'windows-nt)
;; chinese display problems
(set-fontset-font "fontset-default"
'gb18030' ("Microsoft YaHei" . "unicode-bmp"))
;; default path
(setq command-line-default-directory "C:/Users/tree/Desktop/" )
(setq default-directory "C:/Users/tree/Desktop/" )
;; ~file
(setq make-backup-files nil)
(setq backup-directory-alist (quote (("." . "D:/EmacsTemp"))))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PUBLIC CONFIGURATION FILE
;; https://github.com/dholm/tabbar/
(add-to-list 'load-path "~/.emacs.d/plugins/tabbar")
(require 'tabbar)
(tabbar-mode)
;; https://github.com/jaypei/emacs-neotree
(add-to-list 'load-path "~/.emacs.d/plugins/neotree")
(require 'neotree)
(global-set-key [f8] 'neotree-toggle)
;; https://github.com/auto-complete/popup-el
(add-to-list 'load-path "~/.emacs.d/plugins/popup")
(require 'popup)
;; https://github.com/auto-complete/auto-complete
(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete")
(require 'auto-complete-config)
(ac-config-default)
;; https://github.com/capitaomorte/yasnippet
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode nil)
;; auto-complete support yasnippet
(setq-default ac-sources (push 'ac-source-yasnippet ac-sources))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Golang IDE
;; https://github.com/dominikh/go-mode.el
(add-to-list 'load-path "~/.emacs.d/plugins/go-mode")
(require 'go-mode-autoloads)
;; https://github.com/syohex/emacs-go-eldoc
(add-to-list 'load-path "~/.emacs.d/plugins/go-eldoc")
(require 'go-eldoc)
(add-hook 'go-mode-hook 'go-eldoc-setup)
;; https://github.com/nsf/gocode
(add-to-list 'load-path "~/.emacs.d/plugins/gocode/emacs")
(require 'go-autocomplete)
(require 'auto-complete-config)
(ac-config-default)
;; https://github.com/robert-zaremba/flymake-go
;;(add-to-list 'load-path "~/.emacs.d/plugins/glymake-go")
;;(eval-after-load "go-mode"
;; '(require 'flymake-go))
;; golang ide debug
(defun shell-window()
(interactive)
(delete-other-windows)
(switch-to-buffer-other-window "*shell*")
(shell)
(other-window 1)
(enlarge-window 8)
)
(global-set-key [f5] 'shell-window)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Python IDE
;; https://github.com/kiwanami/emacs-epc