summaryrefslogtreecommitdiff
path: root/spacemacs/.emacs.d/private/irony-mode
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2016-09-01 18:05:31 +0200
committerDaniel Schadt <kingdread@gmx.de>2016-09-01 18:05:31 +0200
commitcec01a4a3ebd07fe34dc7a54972b422e1a8c2a8b (patch)
tree6a056f93c63f4ec77bdd103e451cef04a1e35f82 /spacemacs/.emacs.d/private/irony-mode
parent45f2e6ab18eb3bab2b74880ed1f8b211e21596f9 (diff)
downloaddotfiles-cec01a4a3ebd07fe34dc7a54972b422e1a8c2a8b.tar.gz
dotfiles-cec01a4a3ebd07fe34dc7a54972b422e1a8c2a8b.tar.bz2
dotfiles-cec01a4a3ebd07fe34dc7a54972b422e1a8c2a8b.zip
spacemacs: add irony as company backend
This should provide auto-completion with clang's help.
Diffstat (limited to 'spacemacs/.emacs.d/private/irony-mode')
-rw-r--r--spacemacs/.emacs.d/private/irony-mode/packages.el44
1 files changed, 44 insertions, 0 deletions
diff --git a/spacemacs/.emacs.d/private/irony-mode/packages.el b/spacemacs/.emacs.d/private/irony-mode/packages.el
new file mode 100644
index 0000000..ab7fd30
--- /dev/null
+++ b/spacemacs/.emacs.d/private/irony-mode/packages.el
@@ -0,0 +1,44 @@
+(setq irony-mode-packages
+ '(irony
+ company-irony
+ flycheck-irony))
+
+(setq irony-mode-excluded-packages
+ '(auto-complete-clang))
+
+(defun irony-mode/init-irony ()
+ (use-package irony
+ :defer t
+ :init
+ (progn
+ (add-hook 'c++-mode-hook 'irony-mode)
+ (add-hook 'c-mode-hook 'irony-mode)
+ (add-hook 'objc-mode-hook 'irony-mode)
+ (add-hook 'irony-mode-hook
+ (lambda ()
+ (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 'irony-cdb-autosetup-compile-options)
+ (spacemacs|diminish irony-mode " Ⓘ" " I"))))
+
+(defun irony-mode/init-company-irony ()
+ (use-package company-irony
+ :defer t
+ :init
+ (progn
+ (eval-after-load 'company
+ '(add-to-list 'company-backends 'company-irony))
+ (add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
+ (add-hook 'irony-mode-hook 'company-mode))))
+
+(defun irony-mode/init-flycheck-irony ()
+ (use-package flycheck-irony
+ ;; :defer t ; fix this ???
+ :init
+ (progn
+ (eval-after-load 'flycheck
+ '(add-to-list 'flycheck-checkers 'irony))
+ (add-hook 'irony-mode-hook 'flycheck-mode))))
+