mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2024-12-13 21:40:37 +00:00
minor changes
This commit is contained in:
parent
0bbb88f6db
commit
f6ace73656
1 changed files with 11 additions and 9 deletions
|
@ -1,18 +1,18 @@
|
|||
local M = {}
|
||||
|
||||
M.config = function()
|
||||
function on_attach(client, bufnr)
|
||||
local lspconf = require("lspconfig")
|
||||
|
||||
local function on_attach(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
local opts = {noremap = true, silent = true}
|
||||
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
local function buf_set_option(...)
|
||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
end
|
||||
|
||||
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
-- Mappings.
|
||||
local opts = {noremap = true, silent = true}
|
||||
|
||||
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
|
@ -38,18 +38,20 @@ M.config = function()
|
|||
end
|
||||
end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
-- lspInstall + lspconfig stuff
|
||||
|
||||
local function setup_servers()
|
||||
require "lspinstall".setup()
|
||||
|
||||
local lspconf = require("lspconfig")
|
||||
local servers = require "lspinstall".installed_servers()
|
||||
|
||||
for _, lang in pairs(servers) do
|
||||
if lang ~= "lua" then
|
||||
lspconf[lang].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = vim.loop.cwd
|
||||
}
|
||||
elseif lang == "lua" then
|
||||
|
|
Loading…
Reference in a new issue