replace Grammarly with LanguageTool and ltex-ls

This commit is contained in:
DanRoscigno 2023-04-13 15:49:39 -04:00
parent 4399361d16
commit cb8fa64c21
2 changed files with 49 additions and 0 deletions

View File

@ -37,6 +37,54 @@ require('packer').startup(function(use)
}, },
} }
-- use ltex-ls as the languageserver for languagetool
use { 'vigoux/ltex-ls.nvim' }
require 'ltex-ls'.setup {
on_attach = on_attach,
capabilities = capabilities,
use_spellfile = false,
filetypes = { "latex", "tex", "bib", "markdown", "gitcommit", "text" },
settings = {
ltex = {
enabled = { "latex", "tex", "bib", "markdown", },
language = "en",
diagnosticSeverity = "information",
sentenceCacheSize = 2000,
additionalRules = {
enablePickyRules = true,
motherTongue = "en",
},
disabledRules = {
fr = { "APOS_TYP", "FRENCH_WHITESPACE" }
},
dictionary = (function()
-- For dictionary, search for files in the runtime to have
-- and include them as externals the format for them is
-- dict/{LANG}.txt
--
-- Also add dict/default.txt to all of them
local files = {}
for _, file in ipairs(vim.api.nvim_get_runtime_file("dict/*", true)) do
local lang = vim.fn.fnamemodify(file, ":t:r")
local fullpath = vim.fs.normalize(file, ":p")
files[lang] = { ":" .. fullpath }
end
if files.default then
for lang, _ in pairs(files) do
if lang ~= "default" then
vim.list_extend(files[lang], files.default)
end
end
files.default = nil
end
return files
end)(),
},
},
}
use { -- Autocompletion use { -- Autocompletion
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
requires = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' }, requires = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },

View File

@ -108,3 +108,4 @@ chnodes
xyz xyz
Sharding Sharding
sharding sharding
ClickHouse