[[plugins]] repo = 'Shougo/ddu.vim' # on_cmd = ["Ddu"] on_func = ["ddu#"] on_event = ['BufRead', 'CursorHold'] lua_source = ''' -- require("configs/ddu") local keymap = vim.keymap.set local ddu_custom_patch_global = vim.fn["ddu#custom#patch_global"] -- local ddu_ui_ff_do_action = vim.fn["ddu#ui#ff#do_action"] -- local ddu_item_action = vim.fn["ddu#item_action"] -- local ddu_ui_ff_execute = vim.fn["ddu#ui#ff#execute"] local keymap_opt = { buffer = true, silent = true } local columns = vim.opt.columns:get() local width, col = math.floor(columns * 0.8), math.floor(columns * 0.12) ddu_custom_patch_global({ ui = "ff", sources = { { -- default source name = "file_rec", params = { ignoredDirectories = { ".venv", ".git", "node_modules", "vendor", ".next" }, }, }, }, sourceOptions = { _ = { -- matchers = { "matcher_substring" }, matchers = { "matcher_fzf" }, sorters = { "sorter_fzf" }, }, }, -- filterParams = { -- matcher_substring = { -- highlightMatched = "Title", -- }, -- }, filterParams = { matcher_fzf = { highlightMatched = "Search", }, }, kindOptions = { file = { defaultAction = "open", }, buffer = { defaultAction = "open", }, memos = { defaultAction = "echo", } }, uiParams = { ff = { startFilter = true, prompt = "> ", -- prompt = " ", split = "floating", previewFloating = true, previewSplit = "vertical", previewFloatingBorder = "single", previewWidth = math.floor(width / 3), previewHeight = col, -- highlights = { -- floating = "Normal", -- floatingBorder = "Normal", -- }, autoAction = { name = "preview", }, }, }, }) vim.api.nvim_create_autocmd("FileType", { pattern = "ddu-ff", callback = function() print("filetype ddu-ff") keymap("n", "", "call ddu#ui#do_action('itemAction')", keymap_opt) -- nnoremap i -- \ call ddu#ui#ff#do_action('openFilterWindow') -- nnoremap q -- \ call ddu#ui#ff#do_action('quit') -- nnoremap p -- \ call ddu#ui#ff#do_action('preview') keymap("n", "", "call ddu#ui#do_action('toggleSelectItem')", keymap_opt) keymap("n", "i", "call ddu#ui#do_action('openFilterWindow')", keymap_opt) keymap("n", "i", "call ddu#ui#do_action('quit')", keymap_opt) keymap("n", "q", "call ddu#ui#do_action('quit')", keymap_opt) vim.api.nvim_create_autocmd("CursorMoved", { pattern = "*", callback = function() -- call ddu#ui#do_action('quit') vim.fn["ddu#ui#do_action"]("preview") end, }) end, }) vim.api.nvim_create_autocmd("FileType", { pattern = "ddu-ff-filter", callback = function() print("filetype ddu-ff-filter") keymap("i", "", "close", keymap_opt) keymap("i", "", "close", keymap_opt) keymap("n", "", "close", keymap_opt) keymap("n", "q", "call ddu#ui#do_action('quit')", keymap_opt) end, }) ddu_custom_patch_global({ kindOptions = { ["custom-list"] = { defaultAction = "callback", }, }, }) ''' [[plugins]] repo = 'Shougo/ddu-ui-ff' on_source = 'ddu.vim' [[plugins]] repo = 'Shougo/ddu-source-file_rec' on_source = 'ddu.vim' [[plugins]] repo = 'shun/ddu-source-rg' on_source = 'ddu.vim' [[plugins]] repo = 'Shougo/ddu-filter-matcher_substring' on_source = 'ddu.vim' [[plugins]] repo = 'Shougo/ddu-kind-file' on_source = 'ddu.vim' [[plugins]] repo = "Shougo/ddu-source-line" on_source = 'ddu.vim' [[plugins]] repo = "shun/ddu-source-buffer" on_source = 'ddu.vim' [[plugins]] repo = "liquidz/ddu-source-custom-list" on_source = 'ddu.vim' [[plugins]] repo = "4513ECHO/ddu-source-source" on_source = 'ddu.vim' [[plugins]] repo = "yuki-yano/ddu-filter-fzf" on_source = 'ddu.vim' [[plugins]] repo = "4513ECHO/ddu-source-ghq" on_source = 'ddu.vim'