You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
52 lines
1.3 KiB
2 years ago
|
-- Completions --
|
||
|
local cmp = require('cmp')
|
||
|
cmp.setup({
|
||
|
completion = { autocomplete = false },
|
||
|
snippet = {
|
||
|
expand = function (args)
|
||
|
require('snippy').expand_snippet(args.body)
|
||
|
end,
|
||
|
},
|
||
|
mapping = {
|
||
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||
|
['<C-e>'] = cmp.mapping.abort(),
|
||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||
|
},
|
||
|
sources = cmp.config.sources({
|
||
|
{ name = 'nvim_lsp' },
|
||
|
{ name = 'snippy' }
|
||
|
})
|
||
|
})
|
||
|
|
||
|
-- LSP --
|
||
|
-- See: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||
|
local lsp = require('lspconfig')
|
||
|
|
||
|
local capabilities = require('cmp_nvim_lsp')
|
||
|
.update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||
|
|
||
|
lsp.clangd.setup {
|
||
|
filetypes = { 'c', 'cpp', 'cxx' },
|
||
|
capabilities = capabilities
|
||
|
}
|
||
|
|
||
|
lsp.eslint.setup {
|
||
|
capabilities = capabilities
|
||
|
}
|
||
|
|
||
|
lsp.sumneko_lua.setup {
|
||
|
settings = {
|
||
|
Lua = {
|
||
|
runtime = { version = 'LuaJIT' },
|
||
|
diagnostics = { globals = { 'vim' } },
|
||
|
workspace = {
|
||
|
library = vim.api.nvim_get_runtime_file('', true),
|
||
|
},
|
||
|
telemetry = { enable = false },
|
||
|
},
|
||
|
},
|
||
|
capabilities = capabilities,
|
||
|
}
|