Trying to configure lsp-mode on Emacs
This commit is contained in:
parent
a12166d64b
commit
7233ec4d48
8 changed files with 196 additions and 7 deletions
32
users/profiles/emacs/emacs.d/config/config-lsp.el
Normal file
32
users/profiles/emacs/emacs.d/config/config-lsp.el
Normal file
|
@ -0,0 +1,32 @@
|
|||
(defun my-lsp-format-buffer ()
|
||||
(if (eq major-mode 'nix-mode)
|
||||
(lsp-format-buffer)))
|
||||
|
||||
|
||||
(use-package lsp-mode
|
||||
:init
|
||||
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
|
||||
(setq lsp-keymap-prefix "C-c l")
|
||||
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
|
||||
(nix-mode . lsp)
|
||||
;; if you want which-key integration
|
||||
(lsp-mode . lsp-enable-which-key-integration))
|
||||
(before-save . my-lsp-format-buffer)
|
||||
:commands lsp)
|
||||
|
||||
;; optionally
|
||||
(use-package lsp-ui :commands lsp-ui-mode)
|
||||
;; if you are helm user
|
||||
(use-package helm-lsp :commands helm-lsp-workspace-symbol)
|
||||
(use-package lsp-treemacs :commands lsp-treemacs-errors-list)
|
||||
|
||||
;; optionally if you want to use debugger
|
||||
(use-package dap-mode)
|
||||
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
|
||||
|
||||
;; optional if you want which-key integration
|
||||
(use-package which-key
|
||||
:config
|
||||
(which-key-mode))
|
||||
|
||||
(provide 'config-lsp)
|
Loading…
Add table
Add a link
Reference in a new issue