From: Peng Li Date: Sat, 30 May 2015 11:14:11 +0000 (+0800) Subject: emacs: irony mode for c/c++ X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=56e8d165c4c9e28752c82218aff6af65665007aa;p=dotfiles.git emacs: irony mode for c/c++ --- diff --git a/emacs.d/init.el b/emacs.d/init.el index dca0552..aabaed6 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -163,14 +163,16 @@ ;(semantic-mode 1) + +; set LD_LIBRARY_PATH +(setenv "LD_LIBRARY_PATH" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/") +; load irony-mode +;( add-to-list 'load-path (expand-file-name "~/.emacs.d/irony-mode/elisp/")) +(require 'irony) (add-hook 'c++-mode-hook 'irony-mode) (add-hook 'c-mode-hook 'irony-mode) (add-hook 'objc-mode-hook 'irony-mode) - -;;--------------------------------------------------------------------------------------- -;; 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 () @@ -183,7 +185,6 @@ - ;; c/c++ auto-complete, yasnippet, auto-complet-c-headers ;;https://www.youtube.com/watch?v=HTUE03LnaXA&list=PL-mFLc7R_MJet8ItKipCtYc7PWoS5KTfM (require 'auto-complete) @@ -208,19 +209,21 @@ ;; 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) +;(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) +;(add-hook 'c-mode-hook 'google-set-c-style) +;(add-hook 'c++-mode-hook 'google-make-newline-indent) + + ;; cedet (semantic-mode 1) @@ -238,3 +241,4 @@ ;; turn on automatic reparsing of open buffers in semantic (global-semantic-idle-scheduler-mode 1) +(global-semantic-stickyfunc-mode 1)