X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Finit.el;h=a549bfd9dd631988a43a485af27e1ecd5bd7ad8d;hb=6fc14f6c0a348011b7523d6070711aad3eb5f0db;hp=6c3af9b6d2cd0b96744da3407da502fd62891aa7;hpb=4aab4db81a3ad3e507faf8984b2d49bf26c27f6d;p=dotfiles.git diff --git a/emacs.d/init.el b/emacs.d/init.el index 6c3af9b..a549bfd 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -107,7 +107,7 @@ ;(setq speedbar-show-unknown-files t) -(toggle-frame-fullscreen) +;(toggle-frame-fullscreen) (require 'projectile) @@ -140,11 +140,15 @@ (require 'init-ggtags) (global-unset-key "\C-o") +(global-set-key (kbd "C-o C-o") 'keyboard-quit);; same as C-g to quit (global-set-key (kbd "C-o C-f") 'ido-find-file) +(global-set-key (kbd "C-o C-r") 'recentf-ido-find-file) (global-set-key (kbd "C-o C-b") 'ido-switch-buffer) +(global-set-key (kbd "C-o C-j") 'ido-find-file) -(global-set-key (kbd "C-o g") 'ggtags-find-file) -(global-set-key (kbd "C-o t") 'ggtags-find-tag-dwim) + +(global-set-key (kbd "C-o C-g") 'ggtags-find-file) +(global-set-key (kbd "C-o C-t") 'ggtags-find-tag-dwim) (global-set-key (kbd "M-g M-g") 'magit-status) @@ -153,72 +157,17 @@ (setq scroll-conservatively 10000) (show-paren-mode t) -;;; next, cedet & ecb for c++ development -(require 'cc-mode) -(require 'semantic) - -(global-semanticdb-minor-mode 1) -(global-semantic-idle-scheduler-mode 1) - -(semantic-mode 1) - -(add-hook 'c++-mode-hook 'irony-mode) -(add-hook 'c-mode-hook 'irony-mode) -(add-hook 'objc-mode-hook 'irony-mode) +(require 'init-c-cpp) +(require 'recentf) +(recentf-mode 1) +(setq recentf-max-menu-items 100) +(defun recentf-ido-find-file () + "Find a recent file using Ido." + (interactive) + (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t))) + (when file + (find-file file)))) -;;--------------------------------------------------------------------------------------- -;; irony-mode -;; -;; replace the `completion-at-point' and `complete-symbol' bindings in -;; irony-mode's buffers by irony-mode's function -(defun my-irony-mode-hook () - (define-key irony-mode-map [remap completion-at-point] - 'irony-completion-at-point-async) - (define-key irony-mode-map [remap complete-symbol] - 'irony-completion-at-point-async)) -(add-hook 'irony-mode-hook 'my-irony-mode-hook) -(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) - - - - -;; c/c++ auto-complete, yasnippet, auto-complet-c-headers -;;https://www.youtube.com/watch?v=HTUE03LnaXA&list=PL-mFLc7R_MJet8ItKipCtYc7PWoS5KTfM -(require 'auto-complete) -(require 'auto-complete-config) -(ac-config-default) -;; input TAB to -(require 'yasnippet) -(yas-global-mode 1) - -;; auto-complete-c-headers -(defun my:ac-c-header-init () - (require 'auto-complete-c-headers) - (add-to-list 'ac-sources 'ac-source-c-headers) - (add-to-list 'achead:include-directories "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include") -) -;; call this function from c/c++ hooks -(add-hook 'c++-mode-hook 'my:ac-c-header-init) -(add-hook 'c-mode-hook 'my:ac-c-header-init) - -;;; iedit, fix iedit bug in Mac, C-c ; to trigger multiple cursor edit -(define-key global-map (kbd "C-c ;") 'iedit-mode) - -;; flymake-google-cpplint-load -;; define a function for flymake initialization -(defun my:flymake-google-init () - (require 'flymake-google-cpplint) - (custom-set-variables - '(flymake-google-cpplint-command "/usr/local/bin/cpplint")) - (flymake-google-cpplint-load) - ) -(add-hook 'c-mode-hook 'my:flymake-google-init) -(add-hook 'c++-mode-hook 'my:flymake-google-init) - -;; start google-c-style with emacs -(require 'google-c-style) -(add-hook 'c-mode-hook 'google-set-c-style) -(add-hook 'c++-mode-hook 'google-make-newline-indent) - +(require 'recentf-ext)