Use sarcasm/irony-mode for autocompletion + flycheck

This commit is contained in:
Laurens Miers 2017-08-20 16:30:15 +02:00
parent 3cb79c1d9a
commit ee13cbc2ec
4 changed files with 26 additions and 6 deletions

View file

@ -5,4 +5,8 @@ It is mostly based on tuhdo's emacs ide demo: https://github.com/tuhdo/emacs-c-i
This configuration requires the installation of : This configuration requires the installation of :
- the GNU global package (for gtags) - the GNU global package (for gtags)
- clang (for ivory)
- cmake (for ivory)
- llvm-libs (for cmake, somehow not a dependency on Manjaro when installing cmake)
When first checking out this config, run irony-install-server to make and install the irony-server.

View file

@ -1,6 +1,19 @@
;; Add irony as company-backend
(eval-after-load 'company (eval-after-load 'company
'(progn '(add-to-list 'company-backends 'company-irony))
(define-key company-mode-map (kbd "C-:") 'helm-company)
(define-key company-active-map (kbd "C-:") 'helm-company))) ;; Add irony as flycheck hook
(eval-after-load 'flycheck
'(add-hook 'flycheck-mode-hook 'flycheck-irony-setup))
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
;; Add irony-, flycheck-, company-mode to c-mode
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'flycheck-mode)
(add-hook 'c-mode-hook 'company-mode)
;; Set tab to autocomplete or indent depending on context
(global-set-key (kbd "<tab>") 'company-indent-or-complete-common)
(provide 'setup-autocompletion) (provide 'setup-autocompletion)

View file

@ -1,4 +1,4 @@
(setq global-mark-ring-max 5000 ; increase mark ring to contains 5000 entries (setq global-mark-ring-max 5000 ; increase mark ring to contains 5000 entries
mark-ring-max 5000 ; increase kill ring to contains 5000 entries mark-ring-max 5000 ; increase kill ring to contains 5000 entries
mode-require-final-newline t ; add a newline to end of file mode-require-final-newline t ; add a newline to end of file
) )

View file

@ -46,6 +46,9 @@
yasnippet yasnippet
sr-speedbar sr-speedbar
company company
irony
company-irony
flycheck-irony
helm helm
helm-gtags helm-gtags
helm-swoop helm-swoop
@ -97,7 +100,7 @@
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(package-selected-packages (quote (helm-swoop helm)))) '(package-selected-packages (quote (irony helm-swoop helm))))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.