nvim: update nvim-cmp config
add csv support
This commit is contained in:
@@ -1,38 +1,59 @@
|
||||
lua << EOF
|
||||
|
||||
-- Setup nvim-cmp.
|
||||
local cmp = require'cmp'
|
||||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
expand = function(args)
|
||||
-- For `vsnip` user.
|
||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` user.
|
||||
-- vim.fn["vsnip#anonymous"](args.body)
|
||||
|
||||
-- For `luasnip` user.
|
||||
-- require('luasnip').lsp_expand(args.body)
|
||||
|
||||
-- For `ultisnips` user.
|
||||
vim.fn["UltiSnips#Anon"](args.body)
|
||||
end,
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-e>'] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
|
||||
{ name = 'path' },
|
||||
{ name = 'path' },
|
||||
|
||||
{ name = 'ultisnips' },
|
||||
{ name = 'ultisnips' },
|
||||
|
||||
{ name = 'buffer' },
|
||||
|
||||
{ name = 'calc' },
|
||||
{ name = 'calc' },
|
||||
}, {
|
||||
{ name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 },
|
||||
}),
|
||||
experimental = {
|
||||
native_menu = false
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.cmdline('/', {
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(':', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
|
||||
EOF
|
||||
|
||||
@@ -3,6 +3,6 @@ set completeopt=menuone,noinsert,noselect
|
||||
let g:completion_enable_snippet = 'UltiSnips'
|
||||
iunmap <Tab>
|
||||
imap <c-s> <C-R>=UltiSnips#ExpandSnippet()<CR>
|
||||
let g:UltiSnipsExpandTrigger="<c-s>"
|
||||
let g:UltiSnipsJumpForwardTrigger="<c-n>"
|
||||
let g:UltiSnipsJumpBackwardTrigger="<c-p>"
|
||||
"let g:UltiSnipsExpandTrigger="<c-s>"
|
||||
let g:UltiSnipsJumpForwardTrigger="<leader>n"
|
||||
let g:UltiSnipsJumpBackwardTrigger="<leader>p"
|
||||
|
||||
@@ -49,11 +49,15 @@ Plug 'tpope/vim-fugitive'
|
||||
Plug 'mhinz/vim-signify' " Mark edited lines - faster gitgutter
|
||||
" }}}
|
||||
|
||||
" Syntax for random filetypes {{{
|
||||
" Support for random filetypes {{{
|
||||
"Plug 'masukomi/vim-markdown-folding'
|
||||
"Plug 'weirongxu/plantuml-previewer.vim' |
|
||||
"Plug 'plasticboy/vim-markdown'
|
||||
Plug 'kergoth/vim-bitbake' " Bitbake templates and syntax
|
||||
Plug 'pboettch/vim-cmake-syntax'
|
||||
Plug 'aklt/plantuml-syntax'
|
||||
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
|
||||
Plug 'chrisbra/csv.vim'
|
||||
" }}}
|
||||
|
||||
" Other plugins (external tools, etc) {{{
|
||||
@@ -70,13 +74,6 @@ Plug 'michal-h21/vimwiki-sync'
|
||||
Plug 'michal-h21/vim-zettel'
|
||||
" }}}
|
||||
|
||||
" Filetype syntax {{{
|
||||
"Plug 'plasticboy/vim-markdown'
|
||||
Plug 'kergoth/vim-bitbake' " Bitbake templates and syntax
|
||||
Plug 'pboettch/vim-cmake-syntax'
|
||||
Plug 'aklt/plantuml-syntax'
|
||||
" }}}
|
||||
|
||||
" Colorschemes {{{
|
||||
Plug 'jaredgorski/spacecamp'
|
||||
Plug 'lifepillar/vim-gruvbox8'
|
||||
|
||||
Reference in New Issue
Block a user