Switched from rtags back to irony.
This commit is contained in:
parent
64c28b5544
commit
36f955c5dd
109
init.el
109
init.el
|
@ -1,5 +1,5 @@
|
|||
;;; init.el --- tastytea's Emacs init file.
|
||||
;; Time-stamp: <2019-04-10T12:42:14+00:00>
|
||||
;; Time-stamp: <2019-04-11T16:25:04+00:00>
|
||||
|
||||
;;; Commentary:
|
||||
;; I am using this file with Emacs 26, but most of it will probably work with
|
||||
|
@ -188,6 +188,13 @@ With argument, do this that many times."
|
|||
;; Autocompletion mode with many plugins.
|
||||
(unless slow-computer
|
||||
(use-package company
|
||||
:custom
|
||||
;; Show suggestions after entering one character.
|
||||
(company-minimum-prefix-length 1)
|
||||
;; Wrap around at end/beginning of list.
|
||||
(company-selection-wrap-around t)
|
||||
;; Align annotation to the right border.
|
||||
(company-tooltip-align-annotations t)
|
||||
:bind
|
||||
(:map company-active-map
|
||||
("<return>" . nil) ; Disable completion on return.
|
||||
|
@ -203,6 +210,11 @@ With argument, do this that many times."
|
|||
:config
|
||||
(company-flx-mode +1))
|
||||
|
||||
(use-package company-statistics
|
||||
:after company
|
||||
:hook
|
||||
(after-init-hook . company-statistics-mode))
|
||||
|
||||
;; Set default indentation.
|
||||
(setq-default indent-tabs-mode nil
|
||||
tab-width 4)
|
||||
|
@ -305,57 +317,50 @@ With argument, do this that many times."
|
|||
(c-default-style "tastytea"))
|
||||
|
||||
(unless slow-computer
|
||||
(use-package rtags
|
||||
:pin melpa-stable
|
||||
:if (executable-find "llvm-config")
|
||||
:if (executable-find "clang++")
|
||||
:config
|
||||
(unless (and (rtags-executable-find "rc") (rtags-executable-find "rdm"))
|
||||
(progn
|
||||
(message "RTags is not installed!")
|
||||
(rtags-install)))
|
||||
(rtags-enable-standard-keybindings)
|
||||
:bind
|
||||
(:map c-mode-base-map
|
||||
("M-." . rtags-find-symbol-at-point)
|
||||
("M-," . rtags-find-references-at-point)
|
||||
("M-?" . rtags-display-summary))
|
||||
;; irony communicates with a clang-server.
|
||||
(use-package irony
|
||||
:after yasnippet
|
||||
:hook
|
||||
(c++-mode . (rtags-start-process-unless-running))
|
||||
(c-mode . (rtags-start-process-unless-running))
|
||||
(kill-emacs . rtags-quit-rdm)))
|
||||
(c++-mode . irony-mode)
|
||||
(c-mode . irony-mode)
|
||||
(irony-mode . irony-cdb-autosetup-compile-options)
|
||||
:config
|
||||
;; If irony server was never installed, install it.
|
||||
(unless (irony--find-server-executable)
|
||||
(call-interactively #'irony-install-server)))
|
||||
|
||||
(use-package flycheck-rtags
|
||||
:pin melpa-stable
|
||||
:after (flycheck rtags)
|
||||
:config
|
||||
;; ensure that we use only rtags checking.
|
||||
;; https://github.com/Andersbakken/rtags#optional-1
|
||||
(defun my/setup-flycheck-rtags ()
|
||||
(flycheck-select-checker 'rtags)
|
||||
(setq-local flycheck-highlighting-mode nil)) ; Can't disable RTags overlay.
|
||||
:hook
|
||||
(c-mode-hook . my/setup-flycheck-rtags)
|
||||
(c++-mode-hook . my/setup-flycheck-rtags))
|
||||
;; Eldoc shows argument list of the function you are currently writing.
|
||||
(use-package irony-eldoc
|
||||
:after (eldoc irony)
|
||||
:hook
|
||||
(irony-mode . irony-eldoc))
|
||||
|
||||
(use-package company-rtags
|
||||
:pin melpa-stable
|
||||
:after (company rtags)
|
||||
:custom
|
||||
(rtags-completions-enabled t)
|
||||
:config
|
||||
;; (setq rtags-autostart-diagnostics t)
|
||||
;; (rtags-diagnostics)
|
||||
(push 'company-rtags company-backends))
|
||||
; Syntax checker.
|
||||
(use-package flycheck-irony
|
||||
:after (flycheck irony)
|
||||
:hook
|
||||
(flycheck-mode-hook . flycheck-irony-setup))
|
||||
|
||||
;; cmake integration.
|
||||
(unless slow-computer
|
||||
;; Auto-complete integration.
|
||||
(use-package company-irony
|
||||
:after (company irony)
|
||||
:config
|
||||
(add-to-list 'company-backends 'company-irony))
|
||||
|
||||
;; Auto-complete headers
|
||||
(use-package company-irony-c-headers
|
||||
:after (company-irony)
|
||||
:config
|
||||
(add-to-list 'company-backends 'company-irony-c-headers))
|
||||
|
||||
;; cmake integration.
|
||||
(use-package cmake-ide
|
||||
:after rtags
|
||||
:after irony
|
||||
:custom
|
||||
(cmake-ide-build-dir "build")
|
||||
:config
|
||||
(cmake-ide-setup)))
|
||||
(cmake-ide-setup))
|
||||
)
|
||||
|
||||
;; GUI for gdb and other debuggers.
|
||||
(use-package realgud
|
||||
|
@ -672,12 +677,13 @@ With argument, do this that many times."
|
|||
;; The mode is not turned on?
|
||||
("\\`'\\*Easy-hugo\\*\\'" . easy-hugo-mode)))
|
||||
|
||||
;; A template system.
|
||||
(use-package yasnippet)
|
||||
|
||||
;; Automatically insert text in new files.
|
||||
(use-package autoinsert
|
||||
:after yasnippet
|
||||
:init
|
||||
;; I only use it in here for now
|
||||
(use-package yasnippet)
|
||||
|
||||
(defun my/autoinsert-yas-expand()
|
||||
"Replace text in yasnippet template."
|
||||
(yas-minor-mode t)
|
||||
|
@ -724,7 +730,14 @@ With argument, do this that many times."
|
|||
:hook
|
||||
(LaTeX-mode . company-auctex-init))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;; File formats ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;; (X)HTML / CSS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Use company auto-completion.
|
||||
(use-package company-web
|
||||
:after company
|
||||
:config
|
||||
(add-to-list 'company-backends 'company-web-html))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;; Other file formats ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(use-package adoc-mode
|
||||
:mode
|
||||
(("\\.adoc" . adoc-mode))
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
127.0.0.1:51313 25228
|
||||
127.0.0.1:51313 31890
|
||||
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh
|
Loading…
Reference in New Issue
Block a user