Updated nvim which forced me to change the lsp config, no longer using
that plugin (which honestly wasn't doing much) and I am now using the nvim built in perfered way to config the lsps.
This commit is contained in:
parent
ca2d6550fa
commit
0a6c51ad4f
11
init.lua
11
init.lua
|
|
@ -13,7 +13,6 @@ vim.opt.rtp:prepend(lazypath)
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
"morhetz/gruvbox",
|
"morhetz/gruvbox",
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
{ "nvim-telescope/telescope.nvim", dependencies = {"nvim-lua/plenary.nvim"} },
|
{ "nvim-telescope/telescope.nvim", dependencies = {"nvim-lua/plenary.nvim"} },
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
{"sheerun/vim-polyglot", enabled=false},
|
{"sheerun/vim-polyglot", enabled=false},
|
||||||
|
|
@ -49,7 +48,7 @@ require('nvim-treesitter.configs').setup {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
playground = {
|
playground = {
|
||||||
enabled = true,
|
enabled = false,
|
||||||
persist_queries = false,
|
persist_queries = false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -111,8 +110,8 @@ vim.filetype.add({
|
||||||
-- filetype = "odin",
|
-- filetype = "odin",
|
||||||
--}
|
--}
|
||||||
|
|
||||||
local pipepath = vim.fn.stdpath("cache") .. "/server.pipe"
|
--local pipepath = vim.fn.stdpath("cache") .. "/server.pipe"
|
||||||
if not vim.loop.fs_stat(pipepath) then
|
--if not vim.loop.fs_stat(pipepath) then
|
||||||
vim.fn.serverstart(pipepath)
|
-- vim.fn.serverstart(pipepath)
|
||||||
end
|
--end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,39 +37,83 @@ local on_attach = function(client, bufnr)
|
||||||
--vim.keymap.set('i', '<A-.>', v:lua.vim.lsp.omnifunc, bufopts)
|
--vim.keymap.set('i', '<A-.>', v:lua.vim.lsp.omnifunc, bufopts)
|
||||||
end
|
end
|
||||||
|
|
||||||
local lsp_flags = {
|
--local lsp_flags = {
|
||||||
debounce_text_changes = 150, --wtf is this
|
-- debounce_text_changes = 150, --wtf is this
|
||||||
}
|
--}
|
||||||
local lspconfig = require('lspconfig');
|
--local lspconfig = require('lspconfig');
|
||||||
lspconfig.zls.setup {
|
--lspconfig.zls.setup {
|
||||||
on_attach = on_attach,
|
-- on_attach = on_attach,
|
||||||
flags = lsp_flags,
|
-- flags = lsp_flags,
|
||||||
}
|
--}
|
||||||
lspconfig.gopls.setup{
|
--lspconfig.gopls.setup{
|
||||||
on_attach = on_attach,
|
-- on_attach = on_attach,
|
||||||
flags = lsp_flags,
|
-- flags = lsp_flags,
|
||||||
}
|
--}
|
||||||
lspconfig.clangd.setup{
|
--lspconfig.clangd.setup{
|
||||||
on_attach = on_attach,
|
-- on_attach = on_attach,
|
||||||
flags = lsp_flags,
|
-- flags = lsp_flags,
|
||||||
handlers = {
|
-- handlers = {
|
||||||
["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
-- ["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||||
end
|
-- end
|
||||||
|
-- }
|
||||||
|
--}
|
||||||
|
--lspconfig.rust_analyzer.setup{
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
--}
|
||||||
|
--lspconfig.ols.setup{
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
--}
|
||||||
|
--lspconfig.pylsp.setup{
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
-- flags = lsp_flags,
|
||||||
|
--}
|
||||||
|
--lspconfig.gdscript.setup{
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
-- flags = lsp_flags,
|
||||||
|
--}
|
||||||
|
|
||||||
|
local lsps = {
|
||||||
|
{
|
||||||
|
"clangd",
|
||||||
|
{
|
||||||
|
cmd = {
|
||||||
|
'clangd',
|
||||||
|
'--clang-tidy',
|
||||||
|
},
|
||||||
|
root_markers = { '.clangd', 'compile_commands.json' },
|
||||||
|
filetypes = { 'c', 'cpp', 'h' },
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"luals",
|
||||||
|
{
|
||||||
|
cmd = {
|
||||||
|
'lua-language-server',
|
||||||
|
},
|
||||||
|
root_markers = { '.git', 'init.lua' },
|
||||||
|
filetypes = { 'lua' },
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"python-lsp",
|
||||||
|
{
|
||||||
|
cmd = {
|
||||||
|
'pylsp'
|
||||||
|
},
|
||||||
|
root_markers = { '.git' },
|
||||||
|
filetype = { 'py' },
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lspconfig.rust_analyzer.setup{
|
|
||||||
on_attach = on_attach,
|
for _, lsp in pairs(lsps) do
|
||||||
}
|
local name, config = lsp[1], lsp[2]
|
||||||
lspconfig.ols.setup{
|
vim.lsp.enable(name)
|
||||||
on_attach = on_attach,
|
if config then
|
||||||
}
|
vim.lsp.config(name, config)
|
||||||
--lspconfig.pylyzer.setup{}
|
end
|
||||||
lspconfig.pylsp.setup{
|
end
|
||||||
on_attach = on_attach,
|
|
||||||
flags = lsp_flags,
|
|
||||||
}
|
|
||||||
lspconfig.gdscript.setup{
|
|
||||||
on_attach = on_attach,
|
|
||||||
flags = lsp_flags,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue