Remove lsp folder and merge server setups in plugins options file
This commit is contained in:
parent
4f799d3ca9
commit
f1bee6e869
7 changed files with 67 additions and 84 deletions
|
@ -1,8 +0,0 @@
|
|||
-- LSP Server for Ansible
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require'lspconfig'.ansiblels.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = global_attach,
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
-- LSP Server for Bash
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require'lspconfig'.bashls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = global_attach,
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
-- LSP Server for LaTeX
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require'lspconfig'.texlab.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = global_attach,
|
||||
settings = {
|
||||
texlab = {
|
||||
chktex = {
|
||||
onEdit = true,
|
||||
onOpenAndSave = true
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
-- LSP Server for Lua
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require'lspconfig'.sumneko_lua.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = global_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim' },
|
||||
disable = { 'lowercase-global' },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
-- LSP Server for Markdown
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require'lspconfig'.marksman.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = global_attach,
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
-- LSP Server for Python
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require'lspconfig'.jedi_language_server.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = global_attach,
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
-- LSP Servers
|
||||
|
||||
global_attach = function()
|
||||
local attach_fn = function()
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = 0, remap = false })
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { buffer = 0, remap = false })
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { buffer = 0, remap = false })
|
||||
|
@ -12,9 +12,69 @@ global_attach = function()
|
|||
vim.keymap.set('n', '<leader>dl', '<cmd>Telescope diagnostics<CR>', { buffer = 0, remap = false })
|
||||
end
|
||||
|
||||
require('lsp.ansible')
|
||||
require('lsp.bash')
|
||||
require('lsp.latex')
|
||||
require('lsp.lua')
|
||||
require('lsp.markdown')
|
||||
require('lsp.python')
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
-- Ansible
|
||||
require'lspconfig'.ansiblels.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
}
|
||||
|
||||
-- Bash
|
||||
require'lspconfig'.bashls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
}
|
||||
|
||||
-- LaTeX
|
||||
require'lspconfig'.texlab.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
settings = {
|
||||
texlab = {
|
||||
chktex = {
|
||||
onEdit = true,
|
||||
onOpenAndSave = true
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- Lua
|
||||
require'lspconfig'.sumneko_lua.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim' },
|
||||
disable = { 'lowercase-global' },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Markdown
|
||||
require'lspconfig'.marksman.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
}
|
||||
|
||||
-- Python
|
||||
require'lspconfig'.jedi_language_server.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue