From 778bd8b51d8e324517a2bc063ef70a4670679e4d Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Mon, 14 Nov 2022 21:24:46 +0000 Subject: [PATCH] feat: keys for lsp and rust support --- .gitignore | 1 + .lsp-session-v1 | 1 - lisp/editor.el | 2 +- lisp/keybinds.el | 16 ++++++++++++++++ lisp/languages.el | 3 ++- 5 files changed, 20 insertions(+), 3 deletions(-) delete mode 100644 .lsp-session-v1 diff --git a/.gitignore b/.gitignore index 6377d07..ed2e210 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ transient/ bookmarks .last-package-update-day +.lsp* org-roam.db* .org-id-locations diff --git a/.lsp-session-v1 b/.lsp-session-v1 deleted file mode 100644 index 704db90..0000000 --- a/.lsp-session-v1 +++ /dev/null @@ -1 +0,0 @@ -#s(lsp-session ("/home/devraza/Projects/Rust/hello-world") nil #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ()) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ()) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ())) \ No newline at end of file diff --git a/lisp/editor.el b/lisp/editor.el index b56d842..609c181 100644 --- a/lisp/editor.el +++ b/lisp/editor.el @@ -67,7 +67,7 @@ (general-evil-setup t) :init (general-create-definer diancite/leaders - :prefix leader-key)) + :prefix leader-key)) (diancite/leaders :keymaps 'normal diff --git a/lisp/keybinds.el b/lisp/keybinds.el index 6869f41..d64a78f 100644 --- a/lisp/keybinds.el +++ b/lisp/keybinds.el @@ -18,3 +18,19 @@ "m s" '(magit-status :wk "Status") "m d" '(magit-dispatch :wk "Dispatch") "m f" '(magit-status :wk "File Dispatch")) + + +;; Flymake & LSP +(general-create-definer diancite/lsp + :prefix leader-key) + +(diancite/lsp + :keymaps 'normal + "l" '(:wk "LSP") + "l n" '(flymake-goto-next-error :wk "Next Error") + "l p" '(flymake-goto-prev-error :wk "Previous Error") + "l f" '(eglot-format :wk "Format Buffer") + + "l w" '(:wk "Server") + "l w r" '('eglot-shutdown :wk "Restart Server") + "l w q" '('eglot-reconnect :wk "Shutdown Server")) diff --git a/lisp/languages.el b/lisp/languages.el index 5457f74..801917b 100644 --- a/lisp/languages.el +++ b/lisp/languages.el @@ -3,7 +3,8 @@ ;; Markdown (use-package markdown-mode) -(use-package flycheck) +;; Diagnostics +(use-package flymake) ;; eglot - Language Server Protocol ingegration (use-package eglot)