2

I want to setup lsp-cmake lsp server in my vanilla emacs.

I just installed lsp server using pip install cmake-language-server.

I don't know how to configure in my emacs init.el to use the lsp server. The couldn't find any documentation as well for emacs.

How can I configure lsp-cmake in my init file for emacs

1 Answers1

2

You can try something like the following.

(use-package lsp-mode
  :ensure t)

(use-package cmake-mode
  :ensure t
  :mode ("CMakeLists\\.txt\\'" "\\.cmake\\'")
  :hook (cmake-mode . lsp-deferred))

(use-package cmake-font-lock
  :ensure t
  :after cmake-mode
  :config (cmake-font-lock-activate))

The lsp-mode package provides additional features like integration with which-key, showing diagnostics and breadcrumbs, which you may want to explore if they are important for you with cmake-mode.

Swarnendu Biswas
  • 1,378
  • 1
  • 11
  • 24