summaryrefslogtreecommitdiffstats
path: root/lisp/ravi-init-lsp.el
diff options
context:
space:
mode:
authorRavi R Kiran <aine.marina@gmail.com>2021-04-11 19:57:14 (GMT)
committerRavi R Kiran <aine.marina@gmail.com>2021-04-11 19:57:14 (GMT)
commit5a04f24d497de167331b98337330c1b203c161ec (patch)
treee8eff5980d8da802a4a3b45f49a9f7509ec77b60 /lisp/ravi-init-lsp.el
parentb4414aac6c7b9b217386cfd2df8b10c6510ae856 (diff)
downloaddotemacs-5a04f24d497de167331b98337330c1b203c161ec.zip
dotemacs-5a04f24d497de167331b98337330c1b203c161ec.tar.gz
dotemacs-5a04f24d497de167331b98337330c1b203c161ec.tar.bz2
Get rid of cquery and separate out lsp
Diffstat (limited to 'lisp/ravi-init-lsp.el')
-rw-r--r--lisp/ravi-init-lsp.el62
1 files changed, 62 insertions, 0 deletions
diff --git a/lisp/ravi-init-lsp.el b/lisp/ravi-init-lsp.el
new file mode 100644
index 0000000..dc40c9c
--- /dev/null
+++ b/lisp/ravi-init-lsp.el
@@ -0,0 +1,62 @@
+;;; ravi-init-lsp.el --- lsp-mode support -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Ravi Kiran
+
+;; Author: Ravi Kiran <ravi@cramer>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; LSP mode support
+
+;;; Code:
+
+;; 4k is too low; use 1MB minimum for interprocess communication
+(setq read-process-output-max (* 1024 1024))
+
+(use-package lsp-mode
+ :init
+ (setq lsp-keymap-prefix "H-l")
+ :hook ((c-mode . lsp-deferred)
+ (c++-mode . lsp-deferred)
+ ;; (python-mode . lsp-deferred)
+ (lsp-mode . lsp-enable-which-key-integration))
+ :commands (lsp lsp-deferred)
+ :bind (:map lsp-mode-map
+ ("M-<RET>" . lsp-execute-code-action)) ; perhaps helm-lsp-code-actions?
+ :config
+ (setq lsp-enable-file-watchers nil) ; Most of my repos are too large
+ (setq lsp-enable-indentation nil) ; I'll handle indentation myself
+ (use-package helm-lsp
+ :commands helm-lsp-workspace-symbol)
+ (use-package lsp-ui
+ :commands lsp-ui-mode
+ :hook (lsp-mode . lsp-ui-mode)
+ :bind (:map lsp-ui-mode-map
+ ("C-c i" . lsp-ui-imenu))
+ :config
+ (setq lsp-ui-doc-enable t)
+ (setq lsp-ui-peek-show-directory t)
+ (setq lsp-ui-peek-enable t)))
+
+(use-package dap-mode
+ :defer t
+ :after lsp-mode
+ :config
+ (dap-auto-configure-mode))
+
+(provide 'ravi-init-lsp)
+;;; ravi-init-lsp.el ends here