feat(grammar): add +lsp flag to enable lsp-ltex#6683
Conversation
+lsp flag to enable lsp-ltex
e25b34e to
bed44b1
Compare
When the user adds `lsp-ltex` to `lsp-disabled-clients`, or call `+lsp-ltex-disable` in his config to disable `lsp-ltex` by default, this predicate ensures loading `lsp-ltex` only if enabled.
fb0f00f to
044853c
Compare
First, this makes the function documentation matches the desired behavior "Enable for the current buffer", and also, fixes some issues when firing LSP automatically in some modes (as `org-msg-mode`).
|
Is there a way to make this work when composing an email with mu4e? |
@numkem In general, LSP servers try to load an entire workspace, which doesn't works with mails. I didn't dig deeper to figure out a workaround. You can use |
| (+lsp-ltex-enable))) | ||
|
|
||
| (map! :localleader | ||
| :map (text-mode-map latex-mode-map org-mode-map markdown-mode-map) |
There was a problem hiding this comment.
Hi @abougouffa great stuff! I just tried this, and I believe we could also add LaTeX-mode-map here. wdyt?
There was a problem hiding this comment.
Thanks for the feedback @regadas
Yep, it totally makes sens, I thought LaTeX-mode is an alias to latex-mode!
I will add it to the map list.
fcf51b5 to
f783e8e
Compare
f783e8e to
9b42aa4
Compare
9b42aa4 to
9797753
Compare
|
Hi! I just discovered the eglot counterpart for What do you think? Is it worth include it in this PR or it could be in a future one? Thanks. |
|
When using ltex-ls with eglot, you don't actually need the mentioned 3rd party package. You can just call: (set-eglot-client! 'text-mode '("ltex-ls")) |
|
Anybody know how to make it work in programming mode? |
|
Disclaimer: I may be sharing outdated information here!
While there is nothing wrong with using it in prog-mode, I don’t think neither lsp-mode nor eglot support using multiple servers per file. And you would most likely want a server for the language you are editing rather than one for just the text bits.
|
Enable fast grammar checking using
lsp-ltex, which provides integration with the LTeX LS, this last uses LanguageTool to correct grammar. This is way faster and responsive than the currently usedlangtoolpackage.In addition, LTeX LS understands many formats and languages (like Org, Markdown, LaTeX...), so it produces less false positives related to the language keywords, tags, or commands.
The configuration can be used enabling
+lspfor thegrammarmodule.Example Org document after enabling
:checkers (grammar +lsp)