new plugins & organization
This commit is contained in:
@ -3,7 +3,8 @@
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- Plugin: nvim-cmp
|
||||
-- url: https://github.com/hrsh7th/nvim-cmpa
|
||||
-- url: https://github.com/hrsh7th/nvim-cmp
|
||||
|
||||
|
||||
local cmp_status_ok, cmp = pcall(require, 'cmp')
|
||||
if not cmp_status_ok then
|
||||
@ -23,7 +24,7 @@ cmp.setup {
|
||||
end,
|
||||
},
|
||||
|
||||
-- Completion settings
|
||||
-- Completion settings
|
||||
completion = {
|
||||
--completeopt = 'menu,menuone,noselect'
|
||||
keyword_length = 2
|
||||
@ -35,7 +36,7 @@ cmp.setup {
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-d>'] = cmp.mapping.complete(),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
@ -43,7 +44,7 @@ cmp.setup {
|
||||
},
|
||||
|
||||
-- Tab mapping
|
||||
['<leader>g'] = function(fallback)
|
||||
['<Tab>'] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
@ -52,7 +53,7 @@ cmp.setup {
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
['<leader>h'] = function(fallback)
|
||||
['<S-Tab>'] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
@ -65,10 +66,36 @@ cmp.setup {
|
||||
|
||||
-- Load sources, see: https://github.com/topics/nvim-cmp
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim-lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'cmdline'},
|
||||
{ name = 'path' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'zsh' },
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
-- see https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-add-visual-studio-code-dark-theme-colors-to-the-menu
|
||||
vim.cmd[[
|
||||
highlight! link CmpItemMenu Comment
|
||||
" gray
|
||||
highlight! CmpItemAbbrDeprecated guibg=NONE gui=strikethrough guifg=#808080
|
||||
" blue
|
||||
highlight! CmpItemAbbrMatch guibg=NONE guifg=#569CD6
|
||||
highlight! CmpItemAbbrMatchFuzzy guibg=NONE guifg=#569CD6
|
||||
" light blue
|
||||
highlight! CmpItemKindVariable guibg=NONE guifg=#9CDCFE
|
||||
highlight! CmpItemKindInterface guibg=NONE guifg=#9CDCFE
|
||||
highlight! CmpItemKindText guibg=NONE guifg=#9CDCFE
|
||||
" pink
|
||||
highlight! CmpItemKindFunction guibg=NONE guifg=#C586C0
|
||||
highlight! CmpItemKindMethod guibg=NONE guifg=#C586C0
|
||||
" front
|
||||
highlight! CmpItemKindKeyword guibg=NONE guifg=#D4D4D4
|
||||
highlight! CmpItemKindProperty guibg=NONE guifg=#D4D4D4
|
||||
highlight! CmpItemKindUnit guibg=NONE guifg=#D4D4D4
|
||||
]]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user