Emacs: Move lsp-mode to programming/common.
This commit is contained in:
parent
ec7dc0485f
commit
4dd42f705e
|
@ -1,6 +1,6 @@
|
|||
;;; c++.el --- C++ settings. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Time-stamp: <2020-01-10T17:44:43+0100>
|
||||
;; Time-stamp: <2020-01-20T19:27:36+0100>
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -77,63 +77,6 @@
|
|||
(c-default-style "tastytea")
|
||||
)
|
||||
|
||||
(unless slow-computer
|
||||
;; Client for Language Server Protocol servers.
|
||||
(use-package lsp-mode
|
||||
:if (executable-find "clangd")
|
||||
:after (whitespace)
|
||||
|
||||
:custom
|
||||
(lsp-prefer-flymake nil) ; Disable flymake.
|
||||
(lsp-auto-guess-root t) ; Don't ask for project root.
|
||||
(lsp-clients-clangd-args '("-compile-commands-dir=build"))
|
||||
(lsp-eldoc-render-all t) ; Display all eldoc information.
|
||||
|
||||
:config
|
||||
(defun my/lsp-ws-toggle ()
|
||||
(if lsp-ui-peek-mode
|
||||
(my/whitespace-mode-off)
|
||||
(my/whitespace-mode-on)))
|
||||
|
||||
:hook
|
||||
(c++-mode . lsp)
|
||||
(c-mode . lsp)
|
||||
(lsp-ui-peek-mode . my/lsp-ws-toggle) ; Dots in wrong color.
|
||||
)
|
||||
|
||||
;; Eye-candy and flycheck support for lsp-mode.
|
||||
(use-package lsp-ui
|
||||
:after (lsp-mode flycheck)
|
||||
|
||||
:custom
|
||||
(lsp-ui-sideline-enable nil) ; Do not insert doc into buffer.
|
||||
(lsp-ui-doc-include-signature t) ; Include signature in doc popup.
|
||||
(lsp-ui-doc-enable nil) ; Disable doc popup.
|
||||
|
||||
:bind
|
||||
(:map lsp-ui-mode-map
|
||||
("M-." . lsp-ui-peek-find-definitions)
|
||||
("C-M-." . lsp-ui-peek-find-references)
|
||||
)
|
||||
|
||||
:hook
|
||||
(lsp-mode . lsp-ui-mode)
|
||||
)
|
||||
|
||||
;; Completions with lsp-mode.
|
||||
(use-package company-lsp
|
||||
:after (lsp-mode company)
|
||||
|
||||
:config
|
||||
(push 'company-lsp company-backends)
|
||||
)
|
||||
|
||||
;; ivy interface to lsp-mode.
|
||||
(use-package lsp-ivy
|
||||
:after (lsp-mode ivy)
|
||||
)
|
||||
) ; unless slow-computer.
|
||||
|
||||
;; Highlighting and indentation for CMake.
|
||||
(use-package cmake-mode
|
||||
;; The CMake ebuild installs and activates the mode.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; common.el --- Common programming settings. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Time-stamp: <2020-01-20T02:52:53+0100>
|
||||
;; Time-stamp: <2020-01-20T19:27:48+0100>
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -300,5 +300,62 @@
|
|||
)
|
||||
) ; unless slow-computer.
|
||||
|
||||
(unless slow-computer
|
||||
;; Client for Language Server Protocol servers.
|
||||
(use-package lsp-mode
|
||||
:if (executable-find "clangd")
|
||||
:after (whitespace)
|
||||
|
||||
:custom
|
||||
(lsp-prefer-flymake nil) ; Disable flymake.
|
||||
(lsp-auto-guess-root t) ; Don't ask for project root.
|
||||
(lsp-clients-clangd-args '("-compile-commands-dir=build"))
|
||||
(lsp-eldoc-render-all t) ; Display all eldoc information.
|
||||
|
||||
:config
|
||||
(defun my/lsp-ws-toggle ()
|
||||
(if lsp-ui-peek-mode
|
||||
(my/whitespace-mode-off)
|
||||
(my/whitespace-mode-on)))
|
||||
|
||||
:hook
|
||||
(c++-mode . lsp)
|
||||
(c-mode . lsp)
|
||||
(lsp-ui-peek-mode . my/lsp-ws-toggle) ; Dots in wrong color.
|
||||
)
|
||||
|
||||
;; Eye-candy and flycheck support for lsp-mode.
|
||||
(use-package lsp-ui
|
||||
:after (lsp-mode flycheck)
|
||||
|
||||
:custom
|
||||
(lsp-ui-sideline-enable nil) ; Do not insert doc into buffer.
|
||||
(lsp-ui-doc-include-signature t) ; Include signature in doc popup.
|
||||
(lsp-ui-doc-enable nil) ; Disable doc popup.
|
||||
|
||||
:bind
|
||||
(:map lsp-ui-mode-map
|
||||
("M-." . lsp-ui-peek-find-definitions)
|
||||
("C-M-." . lsp-ui-peek-find-references)
|
||||
)
|
||||
|
||||
:hook
|
||||
(lsp-mode . lsp-ui-mode)
|
||||
)
|
||||
|
||||
;; Completions with lsp-mode.
|
||||
(use-package company-lsp
|
||||
:after (lsp-mode company)
|
||||
|
||||
:config
|
||||
(push 'company-lsp company-backends)
|
||||
)
|
||||
|
||||
;; ivy interface to lsp-mode.
|
||||
(use-package lsp-ivy
|
||||
:after (lsp-mode ivy)
|
||||
)
|
||||
) ; unless slow-computer.
|
||||
|
||||
(provide 'programming/common)
|
||||
;;; common.el ends here
|
||||
|
|
Loading…
Reference in New Issue
Block a user