KDE & Emacs
This commit is contained in:
1 parent
edcf5dd381
commit
8d688d1107
50 files changed
+2122
-1267
No files matched your search
@@ -0,0 +1,64 @@
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
dependencies = {
|
||||
'neovim/nvim-lspconfig',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'lukas-reineke/cmp-rg',
|
||||
'onsails/lspkind.nvim'
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local lspkind = require('lspkind')
|
||||
cmp.setup({
|
||||
preselect = 'none',
|
||||
window = {
|
||||
completion = cmp.config.window.bordered({}),
|
||||
documentation = cmp.config.window.bordered({}),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(arg)
|
||||
vim.snippet.expand(arg.body)
|
||||
end
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- ['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-t>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm(),
|
||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
}),
|
||||
sources = cmp.config.sources(
|
||||
{
|
||||
{ name = 'nvim_lsp' },
|
||||
},
|
||||
{
|
||||
{ name = 'path' },
|
||||
},
|
||||
{
|
||||
{ name = 'buffer' },
|
||||
{ name = 'rg', keyword_length = 3 }
|
||||
}
|
||||
),
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol'
|
||||
})
|
||||
},
|
||||
-- view = {
|
||||
-- entries = 'native'
|
||||
-- },
|
||||
})
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
vim.lsp.config('lua_ls', {
|
||||
capabilities = capabilities
|
||||
})
|
||||
vim.lsp.enable('lua_ls')
|
||||
vim.lsp.config('clangd', {
|
||||
capabilities = capabilities
|
||||
})
|
||||
vim.lsp.enable('clangd')
|
||||
end
|
||||
}
|
||||
Reference in new issue
Block a user