Use sarcasm/irony-mode for autocompletion + flycheck
This commit is contained in:
parent
3cb79c1d9a
commit
ee13cbc2ec
4 changed files with 26 additions and 6 deletions
|
|
@ -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 :
|
||||
- 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.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,19 @@
|
|||
;; Add irony as company-backend
|
||||
(eval-after-load 'company
|
||||
'(progn
|
||||
(define-key company-mode-map (kbd "C-:") 'helm-company)
|
||||
(define-key company-active-map (kbd "C-:") 'helm-company)))
|
||||
'(add-to-list 'company-backends 'company-irony))
|
||||
|
||||
;; 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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
mode-require-final-newline t ; add a newline to end of file
|
||||
)
|
||||
|
|
|
|||
5
init.el
5
init.el
|
|
@ -46,6 +46,9 @@
|
|||
yasnippet
|
||||
sr-speedbar
|
||||
company
|
||||
irony
|
||||
company-irony
|
||||
flycheck-irony
|
||||
helm
|
||||
helm-gtags
|
||||
helm-swoop
|
||||
|
|
@ -97,7 +100,7 @@
|
|||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; 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 was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue