[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question Regarding Line Number Mode For Working With LSP Mode
From: |
Samuel Banya |
Subject: |
Re: Question Regarding Line Number Mode For Working With LSP Mode |
Date: |
Thu, 26 May 2022 11:47:25 -0400 |
User-agent: |
Cyrus-JMAP/3.7.0-alpha0-591-gfe6c3a2700-fm-20220427.001-gfe6c3a27 |
Hey Eli,
I tried to do this, but unfortunately using ':hook' for LSP mode within my
config doesn't work for some reason, check the ':hook' section below
(https://github.com/SamuelBanya/SamsEmacs/blob/main/configuration.org)
#+begin_src emacs-lisp
(defun ef/lsp-mode-setup ()
;; Taken from this 'System Crafters' video:
;; https://www.youtube.com/watch?v=E-NAM9U5JYE
;; This allows breadcrumb segments to appear in projects
(setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols))
(lsp-headerline-breadcrumb-mode))
(use-package lsp-mode
:ensure t
:commands (lsp lsp-deferred)
;; Taken from this page:
;; https://www.mattduck.com/lsp-python-getting-started.html
:init
(setq lsp-keymap-prefix "C-c l")
(add-hook 'c-mode-hook 'lsp)
(add-hook 'c++-mode-hook 'lsp)
(add-hook 'python-mode-hook 'lsp)
(add-hook 'ruby-mode-hook 'lsp)
(add-hook 'js2-mode-hook 'lsp)
(add-hook 'typescript-mode-hook 'lsp)
(add-hook 'web-mode-hook 'lsp)
(add-hook 'csharp-mode-hook 'lsp)
(add-hook 'vue-mode-hook 'lsp)
(add-hook 'yaml-mode-hook 'lsp)
:hook
(display-line-numbers-mode)
:config
(lsp-enable-which-key-integration t)
;; Set 'lsp-idle-delay' to 0.5 seconds for quick autocompletion
(setq lsp-idle-delay 0.5)
;; Adding this to force lsp to auto-guess the root directory of the project:
(setq lsp-auto-guess-root t))
#+end_src
On Tue, May 24, 2022, at 10:31 PM, Eli Zaretskii wrote:
> > Date: Tue, 24 May 2022 20:18:24 -0400
> > From: "Samuel Banya" <sbanya@fastmail.com>
> >
> > My last question is this:
> > How do I get the function from 'M-x display-line-numbers-mode' to trigger
> > when LSP mode is engaged?
>
> Turn it on in the LSP mode hook.
>
>