Configuration for ltex-ls and neovim. A note of warning: this has many limitations and is subject to change. Maybe I'll get around to fixing those and making it "stable", who knows.
Install using your favorite package manager. We depend on lspconfig and plenary.nvim. Oh also make sure you have ltex-ls installed.
An example lazy.nvim plugin spec looks something like this:
{
"erooke/ltex.nvim",
dependencies = {
"neovim/nvim-lspconfig",
"nvim-lua/plenary.nvim"
},
}
This plugin is a very thin wrapper around lspconfig
, so thin it doesn't have
its own configuration yet. Replace wherever you would normally call
require('lspconfig').setup(...)
with require('ltex').setup(...)
all your
settings will get passed through while patching things to make a dictionary
file work. For example my configuration looks like this:
ltex.setup({
settings = {
ltex = {
additionalRules = {
languageModel = "~/.local/share/ngrams/",
},
latex = {
commands = {
["\\nameref{}"] = "ignore",
["\\textcite{}"] = "ignore",
["\\subimport{}{}"] = "ignore",
["\\import{}{}"] = "ignore",
["\\texttt{}"] = "ignore",
},
},
},
},
})
- This saves your dictionary to the root of your project with a filename
.dictionary
- This assumes your language is en-US
- Ignored rules and false positives do not persist across sessions as I'm not sure where to save those
Other people have done this too. Their setups are probably better, I just couldn't make em work.