RTAGS: Refactor + enable flycheck according to github wiki
This commit is contained in:
parent
bc3bddf4a8
commit
8e6aaadd92
1 changed files with 16 additions and 5 deletions
21
config.org
21
config.org
|
|
@ -1012,7 +1012,7 @@ https://github.com/Andersbakken/rtags
|
||||||
(use-package rtags-xref
|
(use-package rtags-xref
|
||||||
:ensure t
|
:ensure t
|
||||||
:hook
|
:hook
|
||||||
((c-mode c++-mode objc-mode) . (lambda () (require 'rtags-xref) (rtags-xref-enable)))
|
((c-mode c++-mode objc-mode) . (function rtags-xref-enable))
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package rtags
|
(use-package rtags
|
||||||
|
|
@ -1020,6 +1020,7 @@ https://github.com/Andersbakken/rtags
|
||||||
:init
|
:init
|
||||||
(setq rtags-display-result-backend 'helm)
|
(setq rtags-display-result-backend 'helm)
|
||||||
(setq rtags-completions-enabled t)
|
(setq rtags-completions-enabled t)
|
||||||
|
(setq rtags-autostart-diagnostics t)
|
||||||
:config
|
:config
|
||||||
(rtags-enable-standard-keybindings)
|
(rtags-enable-standard-keybindings)
|
||||||
(define-key c-mode-base-map (kbd "C-M-.") (function rtags-find-symbol))
|
(define-key c-mode-base-map (kbd "C-M-.") (function rtags-find-symbol))
|
||||||
|
|
@ -1027,21 +1028,27 @@ https://github.com/Andersbakken/rtags
|
||||||
(define-key c-mode-base-map (kbd "M-?") (function rtags-find-references-at-point))
|
(define-key c-mode-base-map (kbd "M-?") (function rtags-find-references-at-point))
|
||||||
(define-key c-mode-base-map (kbd "M-i") (function rtags-imenu))
|
(define-key c-mode-base-map (kbd "M-i") (function rtags-imenu))
|
||||||
:hook
|
:hook
|
||||||
((c-mode c++-mode objc-mode) . (lambda () (require 'rtags) (rtags-start-process-unless-running)))
|
((c-mode c++-mode objc-mode) . (function rtags-start-process-unless-running))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; Stolen from the github wiki of rtags
|
||||||
|
(defun my-flycheck-rtags-setup ()
|
||||||
|
(flycheck-select-checker 'rtags)
|
||||||
|
(setq-local flycheck-highlighting-mode nil) ;; RTags creates more accurate overlays.
|
||||||
|
(setq-local flycheck-check-syntax-automatically nil))
|
||||||
|
|
||||||
(use-package flycheck-rtags
|
(use-package flycheck-rtags
|
||||||
:ensure t
|
:ensure t
|
||||||
:hook
|
:hook
|
||||||
((c-mode c++-mode objc-mode) . (lambda () (require 'flycheck-rtags) (flycheck-mode)))
|
(
|
||||||
|
(c-mode c++-mode objc-mode) . (function my-flycheck-rtags-setup)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package company-rtags
|
(use-package company-rtags
|
||||||
:ensure t
|
:ensure t
|
||||||
:config
|
:config
|
||||||
(push 'company-rtags company-backends)
|
(push 'company-rtags company-backends)
|
||||||
:hook
|
|
||||||
((c-mode c++-mode objc-mode) . (lambda () (require 'company)))
|
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
@ -1054,6 +1061,10 @@ https://github.com/Andersbakken/rtags
|
||||||
:bind (
|
:bind (
|
||||||
("<C-tab>" . company-complete)
|
("<C-tab>" . company-complete)
|
||||||
)
|
)
|
||||||
|
:hook
|
||||||
|
(
|
||||||
|
(c-mode c++-mode objc-mode) . company-mode
|
||||||
|
)
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue