all repos

init.lua @ a4c08aec46eaead129c92ab09b75bf068d4cdea3

my nvim config
3 files changed, 48 insertions(+), 51 deletions(-)
feat(lsp): extract servers setup in other file
Author: Smirnov Olexander ss2316544@gmail.com
Committed at: 2022-06-07 22:43:16 +0300
Parent: f76e7bf
M lua/configs/lsp/attach.lua

@@ -16,6 +16,7 @@ buf_map("gr", "<cmd>Telescope lsp_references<cr>")

buf_map("gi", "<cmd>Telescope lsp_implementations<cr>") buf_map("gs", "<cmd>lua vim.lsp.buf.signature_help()<cr>") buf_map("gl", "<cmd>lua vim.diagnostic.open_float()<cr>") + buf_map("<leader>li", "<cmd>LspInfo<cr>") buf_map("<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>") buf_map("<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>") buf_map("<leader>lf", "<cmd>lua vim.lsp.buf.format {async = true}<cr>")
M lua/configs/lsp/init.lua

@@ -12,57 +12,8 @@ capabilities = require("cmp_nvim_lsp").update_capabilities(

vim.lsp.protocol.make_client_capabilities() ), } - -local servers = { - rnix = {}, - denols = {}, - yamlls = { - settings = { - yaml = { - schemaStore = { - enable = true, - url = "https://www.schemastore.org/api/json/catalog.json", - }, - }, - }, - }, - rust_analyzer = { - settings = { - ["rust-analyzer"] = { - cargo = { allFeatures = true }, - checkOnSave = { - command = "clippy", - extraArgs = { "--no-deps" }, - }, - }, - }, - }, - gopls = { - settings = { - gopls = { - linksInHover = false, - analyses = { - unusedparams = true, - unreachable = true, - }, - staticcheck = true, - memoryMode = "Normal", - }, - }, - }, - pyright = { - python = { - disableOrganizeImports = true, - autoSearchPaths = true, - analysis = { useLibraryCodeForTypes = false }, - }, - }, -} - -for name, conf in pairs(servers) do +for name, conf in pairs(require "configs.lsp.servers") do lspconfig[name].setup(vim.tbl_extend("force", options, conf)) end -lspconfig.sumneko_lua.setup(require("lua-dev").setup { - lspconfig = options, -}) +lspconfig.sumneko_lua.setup(require("lua-dev").setup { lspconfig = options })
A lua/configs/lsp/servers.lua

@@ -0,0 +1,45 @@

+return { + denols = {}, + vimls = {}, + yamlls = { + settings = { + yaml = { + schemaStore = { + enable = true, + url = "https://www.schemastore.org/api/json/catalog.json", + }, + }, + }, + }, + rust_analyzer = { + settings = { + ["rust-analyzer"] = { + cargo = { allFeatures = true }, + checkOnSave = { + command = "clippy", + extraArgs = { "--no-deps" }, + }, + }, + }, + }, + gopls = { + settings = { + gopls = { + linksInHover = false, + staticcheck = true, + memoryMode = "Normal", + analyses = { + unusedparams = true, + unreachable = true, + }, + }, + }, + }, + pyright = { + python = { + disableOrganizeImports = true, + autoSearchPaths = true, + analysis = { useLibraryCodeForTypes = false }, + }, + }, +}