From a7b0aa02ca98d48d0a8571794d0c4616171b6c0d Mon Sep 17 00:00:00 2001 From: KemoNine Date: Thu, 27 Jul 2023 17:04:25 -0400 Subject: [PATCH] basic lsp config, add python to lsp config --- .gitignore | 3 ++- code/init.el | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 34c4a51..c580d30 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ code/projects **/projectile.cache **/.persistent-scratch* **/url -**/eshell \ No newline at end of file +**/eshell +**/.lsp-session* \ No newline at end of file diff --git a/code/init.el b/code/init.el index 62ca7f3..51e9023 100644 --- a/code/init.el +++ b/code/init.el @@ -73,7 +73,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; additional packages (add-to-list 'package-selected-packages - '(helm-lsp lsp-ui lsp-mode json-mode python-mode powershell rust-mode origami go-mode yaml-mode lua-mode) + '(helm-xref helm-lsp lsp-ui lsp-mode json-mode python-mode powershell rust-mode origami go-mode yaml-mode lua-mode) ) (when (not kmn/is-dayjob) (add-to-list 'package-selected-packages @@ -89,6 +89,23 @@ ; tab line via centaur tabs (centaur-tabs-mode t) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; lsp-mode +(use-package lsp-mode + :init + ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l") + (setq lsp-keymap-prefix "C-SPC") + :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode) + (python-mode . lsp-deferred) + ;; if you want which-key integration + (lsp-mode . lsp-enable-which-key-integration)) + :commands lsp lsp-deferred) + +;; optionally +(use-package lsp-ui :commands lsp-ui-mode) +;; if you are helm user +(use-package helm-lsp :commands helm-lsp-workspace-symbol) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; programming ; code folding