This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.config/nvim/lua/plugin/lsp/Tex.lua

53 lines
1.6 KiB
Lua
Raw Normal View History

2023-08-08 16:24:15 +03:00
local lspconfig = require('lspconfig')
local config = {
2023-12-05 22:06:39 +03:00
filetypes = { 'text', 'bib', 'gitcommit', 'markdown', 'org', 'plaintex', 'rst', 'rnoweb', 'tex', 'pandoc' },
settings = {
['ltex'] = {
language = "auto"
}
}
2023-08-08 16:24:15 +03:00
}
lspconfig.ltex.setup(config)
vim.api.nvim_create_user_command('SCOn', function (args)
2023-12-05 22:06:39 +03:00
lspconfig.ltex.setup(config)
2023-08-08 16:24:15 +03:00
end, { desc = "Enable spellcheck." })
vim.api.nvim_create_user_command('SCOff', function (args)
2023-12-05 22:06:39 +03:00
lspconfig.ltex.setup { filetypes = {} }
2023-08-08 16:24:15 +03:00
end, { desc = "Disable spellcheck." })
vim.api.nvim_create_user_command('SCLangRU', function (args)
2023-12-05 22:06:39 +03:00
config.settings['ltex'].language = "ru-RU"
lspconfig.ltex.setup(config)
2023-08-08 16:24:15 +03:00
end, { desc = "Set spellcheck to Russian." })
vim.api.nvim_create_user_command('SCLangEN', function (args)
2023-12-05 22:06:39 +03:00
config.settings['ltex'].language = "en-US"
lspconfig.ltex.setup(config)
2023-08-08 16:24:15 +03:00
end, { desc = "Set spellcheck to English." })
vim.api.nvim_create_user_command('SCLangAuto', function (args)
2023-12-05 22:06:39 +03:00
config.settings['ltex'].language = "auto"
lspconfig.ltex.setup(config)
2023-08-08 16:24:15 +03:00
end, { desc = "Set spellcheck to Auto." })
vim.api.nvim_create_user_command('SCForce', function (args)
2023-12-05 22:06:39 +03:00
vim.cmd("setfiletype text")
vim.cmd("SCOn")
2023-08-08 16:24:15 +03:00
end, { desc = "Set buffer type to text." })
vim.api.nvim_create_user_command('SCReset', function (args)
2023-12-05 22:06:39 +03:00
vim.cmd("filetype detect")
vim.cmd("SCLangAuto")
2023-08-08 16:24:15 +03:00
end, { desc = "Set buffer type to auto." })
vim.api.nvim_create_user_command('SCInfo', function (args)
2023-12-05 22:06:39 +03:00
vim.cmd("LspInfo")
2023-08-08 16:24:15 +03:00
end, { desc = "Show info about spellcheck." })
vim.api.nvim_create_user_command('SCInstall', function (args)
2023-12-05 22:06:39 +03:00
vim.cmd("MasonInstall ltex-ls")
2023-08-08 16:24:15 +03:00
end, { desc = "Install spellcheck (requires Mason)." })