local filename = debug.getinfo(1).source:match("[^/]*$") print(string.format("[[WARN]] @%s loading outside config file.", filename)) --- 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", "around", "file" }) ddc_custom_patch_global("sourceOptions", { _ = { matchers = { "matcher_head" }, sorters = { "sorter_rank" }, }, around = { mark = "around" }, ["nvim-lsp"] = { mark = "LSP", forceCompletionPattern = ".w*|:w*|->w*", }, path = { mark = "P", }, file = { mark = "F", isVolatile = true, forceCompletionPattern = [[\S/\S*]], }, }) 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"]() 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, })