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.
|
;;; 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:
|
;;; Commentary:
|
||||||
;; I am using this file with Emacs 26, but most of it will probably work with
|
;; 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.
|
;; Autocompletion mode with many plugins.
|
||||||
(unless slow-computer
|
(unless slow-computer
|
||||||
(use-package company
|
(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
|
:bind
|
||||||
(:map company-active-map
|
(:map company-active-map
|
||||||
("<return>" . nil) ; Disable completion on return.
|
("<return>" . nil) ; Disable completion on return.
|
||||||
|
@ -203,6 +210,11 @@ With argument, do this that many times."
|
||||||
:config
|
:config
|
||||||
(company-flx-mode +1))
|
(company-flx-mode +1))
|
||||||
|
|
||||||
|
(use-package company-statistics
|
||||||
|
:after company
|
||||||
|
:hook
|
||||||
|
(after-init-hook . company-statistics-mode))
|
||||||
|
|
||||||
;; Set default indentation.
|
;; Set default indentation.
|
||||||
(setq-default indent-tabs-mode nil
|
(setq-default indent-tabs-mode nil
|
||||||
tab-width 4)
|
tab-width 4)
|
||||||
|
@ -305,57 +317,50 @@ With argument, do this that many times."
|
||||||
(c-default-style "tastytea"))
|
(c-default-style "tastytea"))
|
||||||
|
|
||||||
(unless slow-computer
|
(unless slow-computer
|
||||||
(use-package rtags
|
;; irony communicates with a clang-server.
|
||||||
:pin melpa-stable
|
(use-package irony
|
||||||
:if (executable-find "llvm-config")
|
:after yasnippet
|
||||||
: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))
|
|
||||||
:hook
|
:hook
|
||||||
(c++-mode . (rtags-start-process-unless-running))
|
(c++-mode . irony-mode)
|
||||||
(c-mode . (rtags-start-process-unless-running))
|
(c-mode . irony-mode)
|
||||||
(kill-emacs . rtags-quit-rdm)))
|
(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
|
;; Eldoc shows argument list of the function you are currently writing.
|
||||||
:pin melpa-stable
|
(use-package irony-eldoc
|
||||||
:after (flycheck rtags)
|
:after (eldoc irony)
|
||||||
:config
|
:hook
|
||||||
;; ensure that we use only rtags checking.
|
(irony-mode . irony-eldoc))
|
||||||
;; 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))
|
|
||||||
|
|
||||||
(use-package company-rtags
|
; Syntax checker.
|
||||||
:pin melpa-stable
|
(use-package flycheck-irony
|
||||||
:after (company rtags)
|
:after (flycheck irony)
|
||||||
:custom
|
:hook
|
||||||
(rtags-completions-enabled t)
|
(flycheck-mode-hook . flycheck-irony-setup))
|
||||||
:config
|
|
||||||
;; (setq rtags-autostart-diagnostics t)
|
|
||||||
;; (rtags-diagnostics)
|
|
||||||
(push 'company-rtags company-backends))
|
|
||||||
|
|
||||||
;; cmake integration.
|
;; Auto-complete integration.
|
||||||
(unless slow-computer
|
(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
|
(use-package cmake-ide
|
||||||
:after rtags
|
:after irony
|
||||||
:custom
|
:custom
|
||||||
(cmake-ide-build-dir "build")
|
(cmake-ide-build-dir "build")
|
||||||
:config
|
:config
|
||||||
(cmake-ide-setup)))
|
(cmake-ide-setup))
|
||||||
|
)
|
||||||
|
|
||||||
;; GUI for gdb and other debuggers.
|
;; GUI for gdb and other debuggers.
|
||||||
(use-package realgud
|
(use-package realgud
|
||||||
|
@ -672,12 +677,13 @@ With argument, do this that many times."
|
||||||
;; The mode is not turned on?
|
;; The mode is not turned on?
|
||||||
("\\`'\\*Easy-hugo\\*\\'" . easy-hugo-mode)))
|
("\\`'\\*Easy-hugo\\*\\'" . easy-hugo-mode)))
|
||||||
|
|
||||||
|
;; A template system.
|
||||||
|
(use-package yasnippet)
|
||||||
|
|
||||||
;; Automatically insert text in new files.
|
;; Automatically insert text in new files.
|
||||||
(use-package autoinsert
|
(use-package autoinsert
|
||||||
|
:after yasnippet
|
||||||
:init
|
:init
|
||||||
;; I only use it in here for now
|
|
||||||
(use-package yasnippet)
|
|
||||||
|
|
||||||
(defun my/autoinsert-yas-expand()
|
(defun my/autoinsert-yas-expand()
|
||||||
"Replace text in yasnippet template."
|
"Replace text in yasnippet template."
|
||||||
(yas-minor-mode t)
|
(yas-minor-mode t)
|
||||||
|
@ -724,7 +730,14 @@ With argument, do this that many times."
|
||||||
:hook
|
:hook
|
||||||
(LaTeX-mode . company-auctex-init))
|
(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
|
(use-package adoc-mode
|
||||||
:mode
|
:mode
|
||||||
(("\\.adoc" . adoc-mode))
|
(("\\.adoc" . adoc-mode))
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
127.0.0.1:51313 25228
|
127.0.0.1:51313 31890
|
||||||
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh
|
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh
|
Loading…
Reference in New Issue
Block a user