Add func/binding to compile in lsp project root

This commit is contained in:
Adam Goldsmith 2021-06-17 22:19:23 -04:00
parent 0385b3ff35
commit dffd96df80
1 changed files with 7 additions and 0 deletions

View File

@ -580,6 +580,7 @@
(use-package lsp-mode
:hook ((python-mode html-mode web-mode css-mode js2-mode typescript-mode java-mode) . lsp)
:bind (:map lsp-mode-map ("C-M-z" . lsp-compile-in-root))
:config
(setq lsp-prefer-flymake nil
lsp-inhibit-message t
@ -589,6 +590,12 @@
lsp-pylsp-plugins-pydocstyle-enabled nil
lsp-pylsp-plugins-flake8-enabled t)
(defun lsp-compile-in-root ()
"Do compilation in the root dir of a project"
(interactive)
(let ((default-directory (lsp-workspace-root)))
(call-interactively 'compile)))
(use-package company-lsp :ensure
:config
(setq company-lsp-enable-snippet t