From a327b831a90f6f2bd4c9e544e176612037c7836e Mon Sep 17 00:00:00 2001 From: finga Date: Fri, 7 Feb 2025 07:28:07 +0100 Subject: [PATCH 1/3] c: Use lsp-mode when c-mode is enabled --- .emacs.d/config/c.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.emacs.d/config/c.el b/.emacs.d/config/c.el index f013035..1373b7b 100644 --- a/.emacs.d/config/c.el +++ b/.emacs.d/config/c.el @@ -1,3 +1,8 @@ ;; set c style to linux and indention to 2 (setq c-default-style "linux" c-basic-offset 2) + +(use-package lsp-mode + :ensure t + :hook + (c-mode . lsp-deferred)) From c7945b9791579a84c4ec7022248615f860f6cb8b Mon Sep 17 00:00:00 2001 From: finga Date: Fri, 7 Feb 2025 07:30:04 +0100 Subject: [PATCH 2/3] dev: Do not replace the word after completion The default behavior when autocompleting infront of a word, without having a whitespace in between, is to replaice the trailing word. This change should prevent that from happening. --- .emacs.d/config/dev.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.emacs.d/config/dev.el b/.emacs.d/config/dev.el index 15f4b1f..1a22ee9 100644 --- a/.emacs.d/config/dev.el +++ b/.emacs.d/config/dev.el @@ -40,7 +40,9 @@ (add-hook 'prog-mode-hook #'flyspell-prog-mode) (use-package lsp-mode - :ensure t) + :ensure t + :config + (setq lsp-completion-default-behaviour ':insert)) (use-package lsp-ui :ensure t From 05ad81c63116200bd1a9dea506bde96a4d3093fb Mon Sep 17 00:00:00 2001 From: finga Date: Fri, 7 Feb 2025 07:32:52 +0100 Subject: [PATCH 3/3] dev: Hide lsp-mode sideline diagnostics Per default errors are inlined right aligned next to the point in code where errors are happening. This change should prevent that error texts are being shown. --- .emacs.d/config/dev.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.emacs.d/config/dev.el b/.emacs.d/config/dev.el index 1a22ee9..d6808c7 100644 --- a/.emacs.d/config/dev.el +++ b/.emacs.d/config/dev.el @@ -50,7 +50,8 @@ ("C-c i" . lsp-ui-doc-show) :config (setq lsp-ui-doc-position 'at-point) - (setq lsp-ui-doc-show-with-mouse nil)) + (setq lsp-ui-doc-show-with-mouse nil) + (setq lsp-ui-sideline-show-diagnostics nil)) (use-package yasnippet :ensure t)