commit 10cfb9c49d88b12f715e3e4556d4c970c482102b
parent 5c5737d6c323397d7f1be69d539bb521df743e54
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date: Mon, 28 Mar 2022 10:42:05 +0200
Use better ltex integration
Diffstat:
3 files changed, 18 insertions(+), 29 deletions(-)
diff --git a/init.lua b/init.lua
@@ -6,6 +6,8 @@ if ok then
imp.enable_profile()
end
+require "plugins" -- Load all plugins
+
vim.g.python_host_prog = "/bin/python"
if jit.os == "Linux" then
@@ -82,7 +84,6 @@ vim.cmd [[language en_US.utf8]]
vim.cmd [[language time POSIX]]
-- Now load plugins and such
-require "plugins" -- Load all plugins
require "mappings"
require "neogit-config"
diff --git a/lua/lsp_config.lua b/lua/lsp_config.lua
@@ -1,7 +1,5 @@
local lsp = require'lspconfig'
local lsp_installer_servers = require'nvim-lsp-installer.servers'
-require("grammar-guard").init()
-
vim.cmd[[packadd nvim-lspconfig]]
vim.diagnostic.config {
@@ -132,6 +130,7 @@ local lsps = {
},
sumneko_lua = (function()
return {
+ capabilities = capabilities,
on_attach = on_attach,
settings = {
Lua = {
@@ -161,27 +160,10 @@ local lsps = {
}
end)(),
texlab = {
- cmd = {vim.fn.expand("$HOME") ..'/.cargo/bin/texlab'},
+ capabilities = capabilities,
on_attach = texlab_attach,
- }
-}
-
-for lname,config in pairs(lsps) do
- local server_available, requested_server = lsp_installer_servers.get_server(lname)
- if server_available then
- requested_server:on_ready(function ()
- local opts = {}
- requested_server:setup(config)
- end)
- if not requested_server:is_installed() then
- -- Queue the server to be installed
- requested_server:install()
- end
- end
-end
-
-local specials = {
- grammar_guard = {
+ },
+ ltex = {
on_attach = on_attach,
capabilities = capabilities,
filetypes = { "latex", "tex", "bib", "markdown", "gitcommit" },
@@ -234,6 +216,16 @@ local specials = {
},
}
-for lname,config in pairs(specials) do
- lsp[lname].setup(config)
+for lname,config in pairs(lsps) do
+ local server_available, requested_server = lsp_installer_servers.get_server(lname)
+ if server_available then
+ requested_server:on_ready(function ()
+ local opts = {}
+ requested_server:setup(config)
+ end)
+ if not requested_server:is_installed() then
+ -- Queue the server to be installed
+ requested_server:install()
+ end
+ end
end
diff --git a/lua/plugins.lua b/lua/plugins.lua
@@ -49,10 +49,6 @@ return packer.startup(function(use)
-- LSP related
use {'neovim/nvim-lspconfig', requires = "williamboman/nvim-lsp-installer"}
use 'nvim-lua/lsp-status.nvim'
- use {
- "brymer-meneses/grammar-guard.nvim",
- requires = {"neovim/nvim-lspconfig", "williamboman/nvim-lsp-installer"}
- }
-- Treesitter related
localuse 'nvim-treesitter/nvim-treesitter'