Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Change ltex configs? #14

Open
Antomek opened this issue Jan 14, 2022 · 1 comment
Open

Change ltex configs? #14

Antomek opened this issue Jan 14, 2022 · 1 comment

Comments

@Antomek
Copy link

Antomek commented Jan 14, 2022

Hi all,

I gave grammar-guard a go, mainly because I wanted to change my ltex-ls language settings easily and so far nothing has worked (e.g. overriding the default configs of nvim-lsp-installer or trying these instructions.

Setting this:

-- setup the ltex-ls LSP config
require("lspconfig").grammar_guard.setup({
	settings = {
		ltex = {
			enabled = { "bibtex", "context", "context.tex", "html", "latex", "markdown", "org", "restructuredtext", "rsweave"},
			language = "en-GB",
			diagnosticSeverity = "information",
			setenceCacheSize = 2000,
			additionalRules = {
				enablePickyRules = false,
				motherTongue = "en",
			},
			trace = { server = "off" },
			dictionary = {},
			disabledRules = {},
			hiddenFalsePositives = {},
		},
	},
})

as my config though, appeared to have no effect (settings remain at default).
Did I make a silly mistake somewhere?
Any tips on how to easily edit my configs? (Even better if I could swap languages with a keymap!)

Thanks!

@engeir
Copy link

engeir commented May 24, 2022

This works for me:

require("nvim-lsp-installer").on_server_ready(function(server)
    -- Specify the default options which we'll use to setup all servers
    local opts = {
        on_attach = on_attach,
    }

    if server.name == "ltex" then
        opts.settings = {
            ltex = {
                enabled = { "latex", "tex", "bib", "markdown" },
                language = "en-GB",
                diagnosticSeverity = "information",
                setenceCacheSize = 2000,
                additionalRules = {
                    enablePickyRules = true,
                    motherTongue = "en",
                },
                trace = { server = "verbose" },
                dictionary = {},
                disabledRules = {},
                hiddenFalsePositives = {},
            },
        }
    end

    server:setup(opts)
end)

See config. This also works, btw.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants