[[plugins]] repo = 'Shougo/ddc.vim' depends = ['context_filetype.vim', 'denops.vim', 'pum.vim'] on_event = 'InsertEnter' hook_source = ''' inoremap ddc#complete_common_string() call ddc#custom#patch_global( \ 'sources', ['around', 'neosnippet', 'rg', 'file'] \ ) call ddc#custom#patch_global('sourceOptions', { \ '_': { \ 'ignoreCase': v:true, \ 'matchers': ['matcher_head'], \ 'sorters': ['sorter_rank'], \ }, \ 'around': { \ 'mark': 'A', \ 'matchers': ['matcher_head', 'matcher_length'], \ }, \ 'cmdline': { \ 'mark': 'CmdL', \ 'forceCompletionPattern': '\S/\S*', \ }, \ 'cmdline-history': { \ 'mark': 'Hist', \ 'sorters': [], \ }, \ 'rg': { \ 'mark': 'rg', \ 'matchers': ['matcher_head', 'matcher_length'], \ 'minAutoCompleteLength': 4, \ }, \ 'neosnippet': { \ 'mark': 'ns', \ 'dup': 'true', \ }, \ 'vsnip': { \ 'mark': "vs", \ 'dup': 'true', \ }, \ 'nvim-lsp': { \ 'mark': 'LSP', \ 'forceCompletionPattern': '\.\w*|:\w*|->\w*' \ }, \ 'file': { \ 'mark': 'F', \ 'isVolatile': v:true, \ 'minAutoCompleteLength': 1000, \ 'forceCompletionPattern': '\S/\S*' \ }, \ }) call ddc#custom#patch_filetype(['ruby', 'typescript', 'dart', 'swift'], 'sources', has('nvim') ? \ ['nvim-lsp', 'vsnip', 'around', 'neosnippet', 'file'] : ['vsnip', 'around', 'neosnippet', 'file'] \ ) " Use pum.vim call ddc#custom#patch_global('completionMenu', 'pum.vim') call ddc#custom#patch_global('autoCompleteEvents', [ \ 'InsertEnter', 'TextChangedI', 'TextChangedP', \ 'CmdlineEnter', 'CmdlineChanged', \ ]) inoremap \ pum#visible() ? 'call pum#map#insert_relative(+1)' : \ (col('.') <= 1 getline('.')[col('.') - 2] =~# '\s') ? \ '' : ddc#manual_complete() inoremap call pum#map#insert_relative(-1) inoremap call pum#map#select_relative(+1) inoremap call pum#map#select_relative(-1) inoremap call pum#map#confirm() inoremap call pum#map#cancel() " inoremap " \ pumvisible() ? '' : " \ (col('.') <= 1 getline('.')[col('.') - 2] =~# '\s') ? " \ '' : ddc#map#manual_complete() " inoremap pumvisible() ? '' : '' call ddc#enable() ''' hook_add = ''' nnoremap : call CommandlinePre(): function! CommandlinePre() abort " Note: It disables default command line completion! cnoremap \ pum#visible() ? 'call pum#map#insert_relative(+1)' : \ ddc#manual_complete() cnoremap call pum#map#insert_relative(-1) cnoremap call pum#map#confirm() cnoremap call pum#map#cancel() " Overwrite sources let s:prev_buffer_config = ddc#custom#get_buffer() call ddc#custom#patch_buffer('sources', \ ['cmdline', 'cmdline-history', 'around']) autocmd User DDCCmdlineLeave ++once call CommandlinePost() " Enable command line completion call ddc#enable_cmdline_completion() call ddc#enable() endfunction function! CommandlinePost() abort " Restore sources call ddc#custom#set_buffer(s:prev_buffer_config) cunmap endfunction ''' [[plugins]] repo = 'Shougo/ddc-sorter_rank' on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-matcher_head' on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-matcher_length' on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-around' on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-rg' on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-nvim-lsp' on_source = 'nvim-lspconfig' [[plugins]] repo = 'LumaKernel/ddc-file' on_source = 'ddc.vim' [[plugins]] repo = 'neovim/nvim-lspconfig' on_ft = ['ruby','typescript', 'dart', 'swift'] if = 'has("nvim")' depends = 'ddc.vim' hook_source = ''' lua << EOF local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true require'lspconfig'.solargraph.setup{} require'lspconfig'.denols.setup{} require'lspconfig'.dartls.setup{} require'lspconfig'.sourcekit.setup{capabilities = capabilities} EOF ''' [[plugins]] repo = 'matsui54/denops-popup-preview.vim' on_source = 'ddc.vim' on_event = 'InsertEnter' hook_source = ''' let g:popup_preview_config = { \ 'delay': 30, \ 'maxWidth': 20, \ 'winblend': 'winblend', \ } call popup_preview#enable() ''' [[plugins]] repo = 'matsui54/denops-signature_help' on_source = 'ddc.vim' on_event = 'InsertEnter' hook_source = ''' let g:signature_help_config = { \ 'style': 'full', \ 'border': v:true, \ } call signature_help#enable() ''' [[plugins]] repo = 'hrsh7th/vim-vsnip' depends = ['vim-vsnip-integ', 'friendly-snippets'] on_source = 'ddc.vim' on_event = 'InsertEnter' hook_add = ''' " Expand imap vsnip#expandable() ? '(vsnip-expand)' : '' smap vsnip#expandable() ? '(vsnip-expand)' : '' " Jump forward or backward imap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' smap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' imap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' smap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' let g:vsnip_snippet_dir = expand('~/dotfiles/vim/snippets') autocmd User PumCompleteDone call vsnip_integ#on_complete_done(g:pum#completed_item) ''' [[plugins]] repo = 'hrsh7th/vim-vsnip-integ' [[plugins]] repo = 'rafamadriz/friendly-snippets' [[plugins]] repo = 'Shougo/neosnippet.vim' depends = ['neosnippet-snippets', 'context_filetype.vim','ddc.vim'] on_event = 'InsertCharPre' on_ft = 'snippet' hook_source = ''' imap (neosnippet_jump_or_expand) smap (neosnippet_jump_or_expand) xmap (neosnippet_expand_target) let g:neosnippet#enable_snipmate_compatibility = 1 let g:neosnippet#enable_completed_snippet = 1 let g:neosnippet#expand_word_boundary = 1 let g:neosnippet#snippets_directory = '~/.vim/snippets' " if has('conceal') " set conceallevel=0 " endif ''' # pum.vim [[plugins]] repo = 'Shougo/pum.vim' [[plugins]] repo = 'Shougo/ddc-cmdline' on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-cmdline-history' on_source = 'ddc.vim'