Update plugins

This commit is contained in:
Alex Yatskov 2022-10-24 22:17:21 -07:00
parent fb7b515cc8
commit bd724f3654
9 changed files with 62 additions and 71 deletions

View File

@ -1,73 +1,64 @@
-- neodev.nvim -- neodev.nvim
local neodev_nvim = require('neodev') local neodev_nvim = require('neodev')
if neodev_nvim then neodev_nvim.setup({})
neodev_nvim.setup({})
end
-- cmp-nvim-lsp, nvim-lspconfig -- cmp-nvim-lsp
local cmp_nvim_lsp = require('cmp_nvim_lsp')
local capabilities = cmp_nvim_lsp.default_capabilities({snippetSupport = false})
-- nvim-lspconfig
local nvim_lspconfig = require('lspconfig') local nvim_lspconfig = require('lspconfig')
if nvim_lspconfig then nvim_lspconfig.clangd.setup({capabilities = capabilities})
local capabilities = vim.lsp.protocol.make_client_capabilities() nvim_lspconfig.gopls.setup({capabilities = capabilities})
nvim_lspconfig.jedi_language_server.setup({capabilities = capabilities})
local cmp_nvim_lsp = require('cmp_nvim_lsp') nvim_lspconfig.rust_analyzer.setup({capabilities = capabilities})
if cmp_nvim_lsp then nvim_lspconfig.tsserver.setup({capabilities = capabilities})
capabilities = cmp_nvim_lsp.update_capabilities(capabilities, {snippetSupport = false}) nvim_lspconfig.sumneko_lua.setup({
end settings = {
Lua = {
nvim_lspconfig.clangd.setup({capabilities = capabilities}) diagnostics = {globals = {'vim'}},
nvim_lspconfig.gopls.setup({capabilities = capabilities}) runtime = {version = 'LuaJIT'},
nvim_lspconfig.jedi_language_server.setup({capabilities = capabilities}) telemetry = {enable = false},
nvim_lspconfig.rust_analyzer.setup({capabilities = capabilities}) workspace = {library = vim.api.nvim_get_runtime_file('', true)},
nvim_lspconfig.tsserver.setup({capabilities = capabilities})
nvim_lspconfig.sumneko_lua.setup({
settings = {
Lua = {
diagnostics = {globals = {'vim'}},
runtime = {version = 'LuaJIT'},
telemetry = {enable = false},
workspace = {library = vim.api.nvim_get_runtime_file('', true)},
},
}, },
}) },
})
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help) vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition) vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action) vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action)
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float) vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format({async = true}) end) vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format({async = true}) end)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist) vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename) vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder) vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder)
vim.keymap.set('n', '<space>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end) vim.keymap.set('n', '<space>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder) vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder)
vim.keymap.set('n', 'K', vim.lsp.buf.hover) vim.keymap.set('n', 'K', vim.lsp.buf.hover)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next) vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration) vim.keymap.set('n', 'gD', vim.lsp.buf.declaration)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition) vim.keymap.set('n', 'gd', vim.lsp.buf.definition)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation)
vim.keymap.set('n', 'gr', vim.lsp.buf.references) vim.keymap.set('n', 'gr', vim.lsp.buf.references)
vim.opt.omnifunc = 'v:lua.vim.lsp.omnifunc' vim.opt.omnifunc = 'v:lua.vim.lsp.omnifunc'
end
-- nvim-cmp -- nvim-cmp
local nvim_cmp = require('cmp') local nvim_cmp = require('cmp')
if nvim_cmp then nvim_cmp.setup({
nvim_cmp.setup({ mapping = {
mapping = { ['<c-d>'] = nvim_cmp.mapping.scroll_docs(-4),
['<c-d>'] = nvim_cmp.mapping.scroll_docs(-4), ['<c-f>'] = nvim_cmp.mapping.scroll_docs(4),
['<c-f>'] = nvim_cmp.mapping.scroll_docs(4), ['<c-n>'] = nvim_cmp.mapping.select_next_item(),
['<c-n>'] = nvim_cmp.mapping.select_next_item(), ['<c-p>'] = nvim_cmp.mapping.select_prev_item(),
['<c-p>'] = nvim_cmp.mapping.select_prev_item(), ['<tab>'] = nvim_cmp.mapping.confirm({ select = true }),
['<tab>'] = nvim_cmp.mapping.confirm({ select = true }), },
}, sources = {
sources = { {name = 'nvim_lsp'},
{name = 'nvim_lsp'}, {name = 'vsnip'},
{name = 'vsnip'}, },
}, snippet = {
snippet = { expand = function(args) vim.fn['vsnip#anonymous'](args.body) end,
expand = function(args) vim.fn['vsnip#anonymous'](args.body) end, },
}, })
})
end

@ -1 +1 @@
Subproject commit affe808a5c56b71630f17aa7c38e15c59fd648a8 Subproject commit 3cf38d9c957e95c397b66f91967758b31be4abe6

@ -1 +1 @@
Subproject commit 0abfa1860f5e095a07c477da940cfcb0d273b700 Subproject commit 1ae05c6c867d9ad44bce811056e861e0d5c531cb

@ -1 +1 @@
Subproject commit dad26d81dfb7393388ec31b6a4b921c4d722a95a Subproject commit 0fbf1c7c71fd65a113b2b83f50c956c15d72e885

@ -1 +1 @@
Subproject commit 0c2cba85fd2fb3202912dfea85f103da2307c3c5 Subproject commit b475883321cb4fed8e932e462d7d85f0693492a1

@ -1 +1 @@
Subproject commit 714ccb7483d0ab90de1b93914f3afad1de8da24a Subproject commit cdb77665bbf23bd2717d424ddf4bf98057c30bb3

@ -1 +1 @@
Subproject commit 35a731bddaf20be0a2a0492cfa489ae6130a4eb6 Subproject commit d8d48b7a8ce12605378fba6391348b99e8a7a4c1

@ -1 +1 @@
Subproject commit 6bffe36862faa601d2de7e54f6e85c1435e832d0 Subproject commit 2fc45dc4bcafb245b613ebd6847a244924735cc6

@ -1 +1 @@
Subproject commit b2caf50a6e3c021c92b236abff70bbb467bce24f Subproject commit 03010115eb8bdda00ce5f845cc2f7025700e33bb