[NeoVim] Configure LTeX

This commit is contained in:
2022-08-22 12:51:12 +02:00
parent 69b73d8323
commit 84dbb0666a
6 changed files with 148 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
local servers = { 'pyright', 'sumneko_lua', 'eslint', 'tsserver', 'ltex' }
local ltex = require('lspconfig.ltex')
-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
@@ -10,7 +12,7 @@ vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local on_attach = function(_, bufnr)
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
@@ -52,6 +54,28 @@ for _, lsp in pairs(servers) do
}
end
require('lspconfig')['ltex'].setup {
on_attach = function(client)
on_attach(client)
ltex.on_attach()
end,
capabilities = capabilities,
flags = {
-- This will be the default in neovim 0.7+
debounce_text_changes = 150,
},
settings = {
ltex = {
dictionary = {},
disabledRules = {},
hiddenFalsePositives = {},
additionalRules = {
enablePickyRules = true,
},
},
},
}
-- luasnip setup
local luasnip = require 'luasnip'
require('luasnip.loaders.from_vscode').lazy_load()