From b68b82873af2611adb9b316f99e201397e054bcd Mon Sep 17 00:00:00 2001 From: ucpr Date: Sun, 31 Mar 2024 07:28:57 +0900 Subject: [PATCH] fix: fix ddu-source-rg conf --- nvim/init.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index d0a6b0a..ba6c29f 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -103,6 +103,7 @@ require('packer').startup(function(use) -- source "Shougo/ddu-source-file", "Shougo/ddu-source-file_rec", + "Shougo/ddu-source-action", "matsui54/ddu-source-file_external", "shun/ddu-source-rg", "4513ECHO/ddu-source-colorscheme", @@ -142,6 +143,11 @@ require('packer').startup(function(use) ignoreCase = true, }, }, + kindOptions = { + action = { + defaultAction = "do", + }, + }, }) vim.fn["ddu#custom#patch_local"]("file_recursive", { sources = { @@ -164,12 +170,6 @@ require('packer').startup(function(use) }, }) vim.fn["ddu#custom#patch_local"]("grep", { - -- , params: #{ input: expand('') }} - sources = { - { - name = { "rg" }, - }, - }, sourceParams = { rg = { args = { "--column", "--no-heading", "--color", "never" }, @@ -193,7 +193,10 @@ require('packer').startup(function(use) callback = function() local opts = { noremap = true, silent = true, buffer = true } vim.keymap.set({ "n" }, "q", [[call ddu#ui#do_action("quit")]], opts) + vim.keymap.set({ "n" }, "a", [[call ddu#ui#do_action("chooseAction")]], opts) vim.keymap.set({ "n" }, "", [[call ddu#ui#do_action("itemAction")]], opts) + vim.keymap.set({ "n" }, "", [[call ddu#ui#do_action("itemAction", {'params': {'command': 'vsplit'}})]], opts) + vim.keymap.set({ "n" }, "", [[call ddu#ui#do_action("itemAction", {'params': {'command': 'split'}})]], opts) vim.keymap.set({ "n" }, "i", [[call ddu#ui#do_action("openFilterWindow")]], opts) vim.keymap.set({ "n" }, "P", [[call ddu#ui#do_action("togglePreview")]], opts) end, @@ -219,7 +222,7 @@ require('packer').startup(function(use) }) vim.keymap.set("n", "ff", "call ddu#start(#{name:'file_recursive'})") - vim.keymap.set("n", "g", "call ddu#start(#{name:'grep'})") + vim.keymap.set("n", "g", "call ddu#start(#{name:'grep', sources: [#{ name: 'rg', params: #{ input: expand('') } }]})") end, }