From: "Samuel Banya" <sbanya@fastmail.com>
To: "Emanuel Berg" <help-gnu-emacs@gnu.org>
Subject: Re: Question Regarding Line Number Mode For Working With LSP Mode
Date: Thu, 26 May 2022 11:47:25 -0400 [thread overview]
Message-ID: <175b3b5e-b8db-4559-a97c-d3463a1c6368@www.fastmail.com> (raw)
In-Reply-To: <83sfoy4a1y.fsf@gnu.org>
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.
>
>
next prev parent reply other threads:[~2022-05-26 15:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 18:15 Question Regarding Line Number Mode For Working With LSP Mode Samuel Banya
2022-05-23 18:43 ` Samuel Banya
2022-05-25 0:18 ` Samuel Banya
2022-05-25 2:31 ` Eli Zaretskii
2022-05-26 15:47 ` Samuel Banya [this message]
2022-05-26 16:24 ` Eli Zaretskii
2022-05-26 18:05 ` Samuel Banya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=175b3b5e-b8db-4559-a97c-d3463a1c6368@www.fastmail.com \
--to=sbanya@fastmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).