diff --git a/init.lua b/init.lua index f9d9c3c..ed9c0b8 100644 --- a/init.lua +++ b/init.lua @@ -13,7 +13,6 @@ vim.opt.rtp:prepend(lazypath) require("lazy").setup({ "nvim-treesitter/nvim-treesitter", "morhetz/gruvbox", - "neovim/nvim-lspconfig", { "nvim-telescope/telescope.nvim", dependencies = {"nvim-lua/plenary.nvim"} }, "windwp/nvim-autopairs", {"sheerun/vim-polyglot", enabled=false}, @@ -49,7 +48,7 @@ require('nvim-treesitter.configs').setup { enable = true, }, playground = { - enabled = true, + enabled = false, persist_queries = false, } } @@ -111,8 +110,8 @@ vim.filetype.add({ -- filetype = "odin", --} -local pipepath = vim.fn.stdpath("cache") .. "/server.pipe" -if not vim.loop.fs_stat(pipepath) then - vim.fn.serverstart(pipepath) -end +--local pipepath = vim.fn.stdpath("cache") .. "/server.pipe" +--if not vim.loop.fs_stat(pipepath) then +-- vim.fn.serverstart(pipepath) +--end diff --git a/lua/keybindings.lua b/lua/keybindings.lua index 1cf0b66..1d5fa58 100644 --- a/lua/keybindings.lua +++ b/lua/keybindings.lua @@ -37,39 +37,83 @@ local on_attach = function(client, bufnr) --vim.keymap.set('i', '', v:lua.vim.lsp.omnifunc, bufopts) end -local lsp_flags = { - debounce_text_changes = 150, --wtf is this -} -local lspconfig = require('lspconfig'); -lspconfig.zls.setup { - on_attach = on_attach, - flags = lsp_flags, -} -lspconfig.gopls.setup{ - on_attach = on_attach, - flags = lsp_flags, -} -lspconfig.clangd.setup{ - on_attach = on_attach, - flags = lsp_flags, - handlers = { - ["textDocument/publishDiagnostics"] = function(err, result, ctx, config) - end +--local lsp_flags = { +-- debounce_text_changes = 150, --wtf is this +--} +--local lspconfig = require('lspconfig'); +--lspconfig.zls.setup { +-- on_attach = on_attach, +-- flags = lsp_flags, +--} +--lspconfig.gopls.setup{ +-- on_attach = on_attach, +-- flags = lsp_flags, +--} +--lspconfig.clangd.setup{ +-- on_attach = on_attach, +-- flags = lsp_flags, +-- handlers = { +-- ["textDocument/publishDiagnostics"] = function(err, result, ctx, config) +-- 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, -} -lspconfig.ols.setup{ - on_attach = on_attach, -} ---lspconfig.pylyzer.setup{} -lspconfig.pylsp.setup{ - on_attach = on_attach, - flags = lsp_flags, -} -lspconfig.gdscript.setup{ - on_attach = on_attach, - flags = lsp_flags, -} + +for _, lsp in pairs(lsps) do + local name, config = lsp[1], lsp[2] + vim.lsp.enable(name) + if config then + vim.lsp.config(name, config) + end +end