nvim: added dictionaries and changed ltex lsp settings

master
tiyn 10 months ago
parent eb4ab1d7d2
commit f789c139cb

@ -118,6 +118,9 @@ vim.g.mapleader = ","
-- load general mapped keys -- load general mapped keys
require('style') require('style')
-- load dictionaries and helper functions
require('dictionaries')
-- load plugins (autoload all files in plugin folder) -- load plugins (autoload all files in plugin folder)
require('loadplugins') require('loadplugins')

@ -0,0 +1,47 @@
-- local dictionary_base = vim.fn.getenv("XDG_CONFIG_HOME") .. "/nvim/lua/dictionaries/"
local dictionary_base = "/home/user/.config/nvim/lua/dictionaries/"
local Dictionary_files = {
["de-DE"] = {"dictionary_de-de.txt", "dictionary_names.txt"},
["en-US"] = {"dictionary_en-us.txt", "dictionary_names.txt"},
}
function GetDictFiles(lang)
local files = Dictionary_files[lang]
if files then
return files
else
return nil
end
end
function ReadFiles(lang)
local files = GetDictFiles(lang)
local dict = {}
if files then
for _, file in ipairs(files) do
local f = assert(io.open(file, "r"))
if f then
for l in f:lines() do
table.insert(dict, l)
end
else
print("Can not read dict file %q", file)
end
end
else
print("Lang %q has no files", lang)
end
return dict
end
for k,v in pairs(Dictionary_files) do
for a,b in pairs(v) do
Dictionary_files[k][a] = dictionary_base .. b
end
end
Dictionaries = {
["de-DE"] = ReadFiles("de-DE"),
["en-US"] = ReadFiles("en-US"),
}

@ -0,0 +1,4 @@
Bonitur
Königinnensubstanz
Magazinbeute
Pollenhose

@ -38,6 +38,7 @@ return {
"yamlls", "yamlls",
} }
}) })
local servers = { local servers = {
lua_ls = { lua_ls = {
Lua = { Lua = {
@ -46,6 +47,13 @@ return {
}, },
telemetry = { enable = false }, telemetry = { enable = false },
}, },
},
ltex = {
ltex = {
-- language = "de-DE",
enabled = { "latex" },
dictionary = Dictionaries,
}
} }
} }
local default = { __index = function() return {} end } local default = { __index = function() return {} end }

Loading…
Cancel
Save