local lspconfig = require("lspconfig") -- Swift LSP lspconfig.sourcekit.setup {} -- Go LSP lspconfig.gopls.setup { cmd = { "gopls" }, filetypes = { "go", "gomod" }, root_dir = lspconfig.util.root_pattern("go.mod", ".git"), settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true, }, }, } -- ruby LSP lspconfig.ruby_lsp.setup({ cmd = { "ruby-lsp" }, -- or provide full path if needed filetypes = { "ruby" }, root_dir = lspconfig.util.root_pattern("Gemfile", ".git"), }) -- Completion local cmp = require("cmp") cmp.setup({ snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.select_next_item(), [""] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ { name = "nvim_lsp" }, { name = "vsnip" }, }, { { name = "buffer" }, { name = "path" }, }) }) -- Syntastic config vim.g.syntastic_swift_checkers = { 'swiftlint', 'swiftpm' }