# AutoComplete plugin [[plugins]] repo = 'Shougo/ddc.vim' # on_event = ['InsertEnter'] on_event = ['BufRead', 'CursorHold'] # on_event = ['BufEnter'] depends = ['denops.vim'] lua_source = ''' -- require("configs/ddc") local ddc_custom_patch_global = vim.fn["ddc#custom#patch_global"] ddc_custom_patch_global("ui", "native") -- vim.fn["ddc#custom#patch_global"]('completionMenu', 'pum.vim') ddc_custom_patch_global("sources", { -- "nvim-lsp", "lsp", "around", "vsnip", "file", }) ddc_custom_patch_global("sourceOptions", { _ = { -- matchers = { "matcher_head" }, -- sorters = { "sorter_rank" }, matchers = { "matcher_fuzzy" }, sorters = { "sorter_fuzzy" }, converters = { "converter_fuzzy" }, }, around = { mark = "around" }, lsp = { mark = "LSP", forceCompletionPattern = ".w*|:w*|->w*", }, path = { mark = "P", }, file = { mark = "F", isVolatile = true, forceCompletionPattern = [[\S/\S*]], }, vsnip = { mark = "vsnip", }, }) vim.fn["ddc#custom#patch_filetype"]({ "ps1", "dosbatch", "autohotkey", "registry" }, { sourceOptions = { file = { forceCompletionPattern = [[\S\\\S*]], }, }, sourceParams = { file = { mode = "win32", }, }, }) -- ddc_custom_patch_global("sourceParams", { -- ["nvim-lsp"] = { kindLabels = { Class = "c" } }, -- }) ddc_custom_patch_global("sourceParams", { ["nvim-lsp"] = { snippetEngine = vim.fn["denops#callback#register"](function(body) vim.fn["vsnip#anonymous"](body) end), enableResolveItem = true, enableAdditionalTextEdit = true, }, path = { cmd = { "fd", "--max-depth", "5" }, }, }) vim.fn["ddc#enable_terminal_completion"]() vim.fn["ddc#enable"]() vim.cmd([[ inoremap \ pumvisible() ? '' : \ (col('.') <= 1 getline('.')[col('.') - 2] =~# '\s') ? \ '' : ddc#map#manual_complete() ]]) vim.api.nvim_create_autocmd("InsertEnter", { callback = function(event) vim.keymap.set({ "i", "s" }, "", function() return vim.fn["vsnip#available"](1) == 1 and "(vsnip-expand-or-jump)" or "" end, { expr = true, noremap = false }) vim.keymap.set({ "i", "s" }, "", function() return vim.fn["vsnip#jumpable"](1) == 1 and "(vsnip-jump-next)" or "" end, { expr = true, noremap = false }) vim.keymap.set({ "i", "s" }, "", function() return vim.fn["vsnip#jumpable"](-1) == 1 and "(vsnip-jump-prev)" or "" end, { expr = true, noremap = false }) vim.keymap.set({ "n", "s" }, "", [[(vsnip-select-text)]], { expr = true, noremap = false }) vim.keymap.set({ "n", "s" }, "", [[(vsnip-cut-text)]], { expr = true, noremap = false }) -- imap pumvisible() ? '' : '' vim.keymap.set("i", "", function() if vim.fn.pumvisible() == 1 then return "" else return "" end end, { expr = true }) end, }) ''' [[plugins]] repo = 'Shougo/ddc-ui-native' on_source = 'ddc.vim' [[plugins]] repo = "uga-rosa/ddc-source-vsnip" on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-around' on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-matcher_head' on_source = 'ddc.vim' [[plugins]] repo = 'Shougo/ddc-sorter_rank' on_source = 'ddc.vim' [[plugins]] repo = "Shougo/ddc-source-nvim-lsp" on_source = 'nvim-lspconfig' [[plugins]] repo = "uga-rosa/ddc-source-lsp-setup" on_source = 'nvim-lspconfig' # on_source = 'ddc.vim' [[plugins]] repo = 'matsui54/denops-signature_help' on_source = 'ddc.vim' lua_source = ''' vim.fn["signature_help#enable"]() ''' [[plugins]] repo = 'matsui54/denops-popup-preview.vim' on_source = 'ddc.vim' lua_source = ''' vim.fn["popup_preview#enable"]() ''' # [[plugins]] # repo = 'tani/ddc-path' # on_source = 'ddc.vim' [[plugins]] repo = 'LumaKernel/ddc-source-file' on_source = 'ddc.vim' # Snippet Engine [[plugins]] repo = 'hrsh7th/vim-vsnip' on_source = 'ddc.vim' lua_source = """ vim.g.vsnip_filetypes = { javascriptreact = "javascript", typescriptreact = "typescript", } vim.g.vsnip_snippet_dirs = { -- vim.fn.expand("~/.cache/dpp/repos/github.com/rafamadriz/friendly-snippets/snippets"), vim.fn.expand("~/.vsnip/snippets") } """ [[plugins]] repo = 'rafamadriz/friendly-snippets' on_source = 'ddc.vim' [[plugins]] repo = 'tani/ddc-fuzzy' on_source = 'ddc.vim' [[plugins]] repo = 'matsui54/ddc-matcher_fuzzy' on_source = 'ddc.vim' [[plugins]] repo = 'uga-rosa/ddc-source-vsnip' on_source = 'ddc.vim' [[plugins]] repo = 'uga-rosa/denippet.vim' on_source = 'ddc.vim'