|
48 | 48 |
|
49 | 49 | (global-set-key (kbd "C-x g") 'magit-status)
|
50 | 50 |
|
51 |
| -;;--------------------- Key Chords ----------------------- |
52 |
| -;; (require 'key-chord) |
53 |
| -;; (key-chord-define-global "fg" 'forward-word) |
54 |
| -;; (key-chord-define-global "df" 'backward-word) |
55 |
| -;; (key-chord-define-global "hj" 'undo) |
56 |
| -;; (key-chord-mode 1) |
57 |
| - |
58 | 51 | ;;------------------- Switch Window ----------------------
|
59 | 52 | (require 'switch-window)
|
60 | 53 | (global-set-key (kbd "C-x o") 'switch-window)
|
|
117 | 110 | (define-key helm-gtags-mode-map (kbd "C-c <") 'helm-gtags-previous-history)
|
118 | 111 | (define-key helm-gtags-mode-map (kbd "C-c >") 'helm-gtags-next-history)
|
119 | 112 |
|
120 |
| -;;-------------------- Workgroups ------------------------ |
121 |
| -(require 'workgroups2) |
122 |
| -;; Prefix key |
123 |
| -(setq wg-prefix-key (kbd "C-c w")) |
124 |
| -(setq wg-session-file "~/.emacs.d/.workgroups") |
125 |
| -;; Keyboard shortcuts - load, save, switch |
126 |
| -(global-set-key (kbd "<pause>") 'workgroups-mode) |
127 |
| -(global-set-key (kbd "C-<pause>") 'wg-save-session) |
128 |
| -(global-set-key (kbd "s-z") 'wg-switch-to-workgroup) |
129 |
| -(global-set-key (kbd "s-/") 'wg-switch-to-previous-workgroup) |
130 |
| -(set-face-attribute 'wg-brace-face nil :inherit font-lock-builtin-face :weight 'normal :height 0.8) |
131 |
| -(set-face-attribute 'wg-divider-face nil :inherit font-lock-builtin-face :weight 'normal :height 0.8) |
132 |
| -(set-face-attribute 'wg-mode-line-face nil :weight 'thin :height 0.8) |
133 |
| -; When using emacs as a daemon, do not load the WGs automatically. |
134 |
| -;(setq wg-use-default-session-file nil) |
135 |
| -;; Do not start it by default. |
136 |
| -;(workgroups-mode 1) |
137 |
| - |
138 |
| -;;----------------------- IDO --------------------------- |
139 |
| -;; (require 'ido) |
140 |
| -;; (ido-mode) |
141 |
| -;; ;; Display ido results vertically, rather than horizontally. |
142 |
| -;; (require 'ido-vertical-mode) |
143 |
| -;; (ido-vertical-mode 1) |
144 |
| -;; ;; Use ido completion in projectile. |
145 |
| -;; (setq projectile-completion-system 'ido) |
| 113 | +;;-------------------- persp-mode ------------------------ |
| 114 | +(require 'persp-mode) |
| 115 | +(global-set-key (kbd "<pause>") 'persp-mode) |
| 116 | +(global-set-key (kbd "s-z") 'persp-switch) |
| 117 | +; Location where perspectives are stored. |
| 118 | +(setq persp-save-dir "/home/boy/.emacs.d/.persp/") |
| 119 | +; Load the auto saved perpectives as soon as persp-mode is activated. |
| 120 | +(setq persp-auto-resume-time 0.1) |
146 | 121 |
|
147 | 122 | ;;------------------ Maximize Window --------------------
|
148 |
| -;(require 'maxframe) |
149 |
| -;(setq mf-max-width 1920) |
150 |
| -;(add-hook 'window-setup-hook 'maximize-frame t) |
151 | 123 | (add-to-list 'initial-frame-alist '(fullscreen . maximized))
|
152 |
| -;(add-to-list 'default-frame-alist '(fullscreen . maximized)) |
153 | 124 |
|
154 | 125 | ;;-------------------- Yasnippet ------------------------
|
155 | 126 | (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
|
156 | 127 | (require 'yasnippet)
|
157 | 128 | ;(yas-reload-all)
|
158 | 129 | (yas-global-mode 1)
|
159 | 130 | ; Display a popup for the available options.
|
160 |
| -(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete/lib/popup") |
161 |
| -(require 'popup) |
162 |
| -; Add some shotcuts in popup menu mode |
163 |
| -(define-key popup-menu-keymap (kbd "M-n") 'popup-next) |
164 |
| -(define-key popup-menu-keymap (kbd "TAB") 'popup-next) |
165 |
| -(define-key popup-menu-keymap (kbd "<tab>") 'popup-next) |
166 |
| -(define-key popup-menu-keymap (kbd "<backtab>") 'popup-previous) |
167 |
| -(define-key popup-menu-keymap (kbd "M-p") 'popup-previous) |
168 |
| - |
169 |
| -(defun yas-popup-isearch-prompt (prompt choices &optional display-fn) |
170 |
| - (when (featurep 'popup) |
171 |
| - (popup-menu* |
172 |
| - (mapcar |
173 |
| - (lambda (choice) |
174 |
| - (popup-make-item |
175 |
| - (or (and display-fn (funcall display-fn choice)) |
176 |
| - choice) |
177 |
| - :value choice)) |
178 |
| - choices) |
179 |
| - :prompt prompt |
180 |
| - ;; start isearch mode immediately |
181 |
| - :isearch t |
182 |
| - ))) |
183 |
| -(setq yas-prompt-functions '(yas-popup-isearch-prompt yas-no-prompt)) |
184 |
| -;; (add-hook 'js-mode-hook |
185 |
| -;; '(lambda () |
186 |
| -;; (yas-minor-mode))) |
| 131 | +;; (add-to-list 'load-path "~/.emacs.d/plugins/auto-complete/lib/popup") |
| 132 | +;; (require 'popup) |
| 133 | +;; ; Add some shotcuts in popup menu mode |
| 134 | +;; (define-key popup-menu-keymap (kbd "M-n") 'popup-next) |
| 135 | +;; (define-key popup-menu-keymap (kbd "TAB") 'popup-next) |
| 136 | +;; (define-key popup-menu-keymap (kbd "<tab>") 'popup-next) |
| 137 | +;; (define-key popup-menu-keymap (kbd "<backtab>") 'popup-previous) |
| 138 | +;; (define-key popup-menu-keymap (kbd "M-p") 'popup-previous) |
| 139 | + |
| 140 | +;; (defun yas-popup-isearch-prompt (prompt choices &optional display-fn) |
| 141 | +;; (when (featurep 'popup) |
| 142 | +;; (popup-menu* |
| 143 | +;; (mapcar |
| 144 | +;; (lambda (choice) |
| 145 | +;; (popup-make-item |
| 146 | +;; (or (and display-fn (funcall display-fn choice)) |
| 147 | +;; choice) |
| 148 | +;; :value choice)) |
| 149 | +;; choices) |
| 150 | +;; :prompt prompt |
| 151 | +;; ;; start isearch mode immediately |
| 152 | +;; :isearch t |
| 153 | +;; ))) |
| 154 | +;; (setq yas-prompt-functions '(yas-popup-isearch-prompt yas-no-prompt)) |
| 155 | + |
| 156 | +;;---------------------- Company Mode---------------------- |
| 157 | +(add-to-list 'load-path "~/.emacs.d/plugins/company-mode") |
| 158 | +(require 'company) |
| 159 | +(add-hook 'after-init-hook 'global-company-mode) |
187 | 160 |
|
188 | 161 | ;;--------------------- Auto Complete----------------------
|
189 |
| -(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete") |
190 |
| -(require 'auto-complete-config) |
191 |
| -(add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete/dict") |
192 |
| -(setq ac-comphist-file "~/.emacs.d/plugins/auto-complete/ac-comphist.dat") |
193 |
| -(ac-config-default) |
| 162 | +;; (add-to-list 'load-path "~/.emacs.d/plugins/auto-complete") |
| 163 | +;; (require 'auto-complete-config) |
| 164 | +;; (add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete/dict") |
| 165 | +;; (setq ac-comphist-file "~/.emacs.d/plugins/auto-complete/ac-comphist.dat") |
| 166 | +;; (ac-config-default) |
194 | 167 | ; set the trigger key so that it can work together with yasnippet on tab key,
|
195 | 168 | ; if the word exists in yasnippet, pressing tab will cause yasnippet to
|
196 | 169 | ; activate, otherwise, auto-complete will
|
|
200 | 173 |
|
201 | 174 | ;;-------------------- Smooth Scroll ----------------------
|
202 | 175 | (require 'smooth-scrolling)
|
203 |
| - |
204 |
| -;;----------------------- Tabbar -------------------------- |
205 |
| - |
206 |
| -;; (cond (window-system |
207 |
| -;; (require 'tabbar) |
208 |
| -;; (tabbar-mode 1) |
209 |
| -;; (global-set-key [(control shift up)] 'tabbar-backward-group) |
210 |
| -;; (global-set-key [(control shift down)] 'tabbar-forward-group) |
211 |
| -;; (global-set-key [(control shift left)] 'tabbar-backward) |
212 |
| -;; (global-set-key [(control shift right)] 'tabbar-forward) |
213 |
| -;; )) |
0 commit comments