From d5d73ff33f9aec8dc6037915408d2997b3b40d12 Mon Sep 17 00:00:00 2001 From: Curt Spark Date: Fri, 24 Apr 2020 01:40:34 +0100 Subject: [PATCH] LSP Mode --- config.org | 37 +++++++++++++++++++++++++------------ init.el | 2 +- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/config.org b/config.org index 82c48e3..078c788 100644 --- a/config.org +++ b/config.org @@ -405,6 +405,13 @@ Install the package, enable it and ensure that it always is installed, and then :init (company-quickhelp-mode)) #+END_SRC +**** Company Box +Company Box Mode is a mode that gives Company menu options icons. +#+BEGIN_SRC emacs-lisp + (use-package company-box + :ensure t + :hook (company-mode . company-box-mode)) +#+END_SRC ** Multiple Cursors The Multiple Cursors package is pretty self explanatory, you can select and manipulate multiple lines of the same text at the same time, move the cursors in unison. Etc. Install the package, enable it and ensure that it always is installed, and then bind the useful functions to a mnenomic key chord: @@ -426,13 +433,16 @@ Install the package, enable it and ensure that it always is installed, and then ("C-c e" . 'er/expand-region)) #+END_SRC ** LSP Mode -LSP mode will give you IDE capabilities in Emacs, using Microsoft's Universal Language Server Protocol. The same one that VSCode uses for linting, autocompletion. Etc. -Install the package, enable it and ensure that it always is installed, add a hook to make sure it only is activated on Programming Related Major Modes, and set a keychord for the custom prefix. -+BEGIN_SRC emacs-lisp - - ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l") - (setq lsp-keymap-prefix "s-l") - +LSP mode will give you IDE capabilities in Emacs, using Microsoft's +Universal Language Server Protocol. The same one that VSCode uses for +linting, autocompletion. Etc. Install the package, enable it and +ensure that it always is installed, add a hook to make sure it only is +activated on Programming Related Major Modes, and set a keychord for +the custom prefix. Please check +`https://github.com/emacs-lsp/lsp-mode#installation` for instructions +on how to install the Programming Language Servers that you want. +*** Lsp Mode +#+BEGIN_SRC emacs-lisp (use-package lsp-mode :ensure t :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode) @@ -440,10 +450,13 @@ Install the package, enable it and ensure that it always is installed, add a hoo ;; if you want which-key integration (lsp-mode . lsp-enable-which-key-integration)) :commands lsp) -+END_SRC + + ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l") + (setq lsp-keymap-prefix "s-l") +#+END_SRC *** Configuration -+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp ;; optionally (use-package lsp-ui :commands lsp-ui-mode :ensure t) @@ -454,11 +467,11 @@ Install the package, enable it and ensure that it always is installed, add a hoo ;; if you are ivy user (use-package lsp-ivy :commands lsp-ivy-workspace-symbol :ensure t) - (use-package lsp-treemacs :commands lsp-treemacs-errors-list - :ensure t) + ;;(use-package lsp-treemacs :commands lsp-treemacs-errors-list + ;; :ensure t) ;; optionally if you want to use debugger (use-package dap-mode :ensure t) ;; (use-package dap-LANGUAGE) to load the dap adapter for your language -+END_SRC +#+END_SRC diff --git a/init.el b/init.el index daf4420..779da4a 100644 --- a/init.el +++ b/init.el @@ -55,7 +55,7 @@ '(objed-cursor-color "#874804") '(package-selected-packages (quote - (bug-hunter ewal-doom-themes ewal-evil-cursors ewal-spacemacs-themes ewal org-bullets company flyspell-correct-ivy evil ivy which-key use-package))) + (omnisharp csharp-mode bug-hunter ewal-doom-themes ewal-evil-cursors ewal-spacemacs-themes ewal org-bullets company flyspell-correct-ivy evil ivy which-key use-package))) '(pdf-view-midnight-colors (quote ("#655370" . "#fbf8ef"))) '(rustic-ansi-faces ["#040201" "#874804" "#813c07" "#a45101" "#A76A19" "#D76C03" "#F09010" "#e8c99f"])