diff --git a/nvim/lua/lsp.lua b/nvim/lua/lsp.lua index 28678aa..4b6e7fa 100644 --- a/nvim/lua/lsp.lua +++ b/nvim/lua/lsp.lua @@ -1,55 +1,15 @@ -local nvim_lsp = require("lspconfig") local capabilities = require('cmp_nvim_lsp').default_capabilities() -- ######################## -- #### Set up LSPs #### -- ######################## +require('lspconfig') -local util = require("lspconfig.util") - --- Rust --- Python LSP -nvim_lsp.pylsp.setup({ - -- cmd = {"/home/noah/.envs/nvim/bin/pylsp"}, - root_dir = function(fname) - local root_files = { - "pants.toml", "pyproject.toml", "setup.py", "setup.cfg", "Pipfile" - } - return util.find_git_ancestor(fname) or - util.root_pattern(unpack(root_files))(fname) - end +vim.lsp.config("*", { + capabilities = capabilities }) -nvim_lsp.lua_ls.setup { - 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" } - }, - 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 } - } - } -} - -nvim_lsp.janet_lsp.setup { - cmd = { - "janet", - "-i", - "/home/noah/repos/janet-lsp/jpm_tree/lib/janet-lsp.jimage", - "--stdio", - } -} --- LSPs that just use default config -local simple_lsps = { +local servers = { + "pylsp", "lua_ls", "janet_lsp", --"htmx", "nil_ls", "bzl", "buf_ls", "crystalline", "dockerls", "erlangls", "elixirls", "fortls", "gleam", "gopls", "hls", "jsonls", @@ -63,19 +23,8 @@ local simple_lsps = { -- disabled because it's broken -- "scheme_langserver", } --- #simple_lsps is the length of the table when treated as a list... funky! -for _, v in pairs(simple_lsps) do - nvim_lsp[v].setup { - capabilities = capabilities - } -end - -nvim_lsp.fennel_ls.setup({ - capabilities = capabilities, - root_dir = nvim_lsp.util.root_pattern(".git", "fnl") -}) +vim.lsp.enable(servers) --- Whenever an LSP is attached to a buffer local on_attach = function(ev) -- Enable completion triggered by vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' diff --git a/nvim/lua/lsp/fennel_ls.lua b/nvim/lua/lsp/fennel_ls.lua new file mode 100644 index 0000000..ec47434 --- /dev/null +++ b/nvim/lua/lsp/fennel_ls.lua @@ -0,0 +1,3 @@ +return { + root_markers = {".git", "fnl"}, +} diff --git a/nvim/lua/lsp/janet_lsp.lua b/nvim/lua/lsp/janet_lsp.lua new file mode 100644 index 0000000..c3f4b56 --- /dev/null +++ b/nvim/lua/lsp/janet_lsp.lua @@ -0,0 +1,8 @@ +return { + cmd = { + "janet", + "-i", + "/home/noah/repos/janet-lsp/jpm_tree/lib/janet-lsp.jimage", + "--stdio", + } +} diff --git a/nvim/lua/lsp/lua_ls.lua b/nvim/lua/lsp/lua_ls.lua new file mode 100644 index 0000000..fa9700a --- /dev/null +++ b/nvim/lua/lsp/lua_ls.lua @@ -0,0 +1,20 @@ +return { + 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", "vis" } + }, + 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 } + } + } +} diff --git a/nvim/lua/lsp/pylsp.lua b/nvim/lua/lsp/pylsp.lua new file mode 100644 index 0000000..92ca1f1 --- /dev/null +++ b/nvim/lua/lsp/pylsp.lua @@ -0,0 +1,4 @@ +return { + -- cmd = {"/home/noah/.envs/nvim/bin/pylsp"}, + root_markers = { "pants.toml", "pyproject.toml", "setup.py", "setup.cfg", "Pipfile" }, +} diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index fdbfb24..34a0bec 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -325,28 +325,6 @@ require("lazy").setup({ cmd = { "Lf" }, dependencies = { "voldikss/vim-floaterm" } }, - { - "olimorris/codecompanion.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - opts = { - adapters = { - ollama = function() - return require("codecompanion.adapters").extend("ollama", { - env = { - url = "http://localhost:11434", - }, - parameters = { - sync = false, - } - }) - end - }, - }, - priority = 10000, - }, { "imsnif/kdl.vim", lazy = true, ft = "kdl" }, { "catgoose/nvim-colorizer.lua", lazy = true, ft = { "css", "html", "toml", "conf" } }, { "github/copilot.vim", lazy = true, cmd = { "Copilot" } }