Skip to content

Commit

Permalink
fix: fix ddu-source-rg conf
Browse files Browse the repository at this point in the history
  • Loading branch information
ucpr committed Mar 30, 2024
1 parent 8673718 commit b68b828
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -142,6 +143,11 @@ require('packer').startup(function(use)
ignoreCase = true,
},
},
kindOptions = {
action = {
defaultAction = "do",
},
},
})
vim.fn["ddu#custom#patch_local"]("file_recursive", {
sources = {
Expand All @@ -164,12 +170,6 @@ require('packer').startup(function(use)
},
})
vim.fn["ddu#custom#patch_local"]("grep", {
-- , params: #{ input: expand('<cword>') }}
sources = {
{
name = { "rg" },
},
},
sourceParams = {
rg = {
args = { "--column", "--no-heading", "--color", "never" },
Expand All @@ -193,7 +193,10 @@ require('packer').startup(function(use)
callback = function()
local opts = { noremap = true, silent = true, buffer = true }
vim.keymap.set({ "n" }, "q", [[<Cmd>call ddu#ui#do_action("quit")<CR>]], opts)
vim.keymap.set({ "n" }, "a", [[<Cmd>call ddu#ui#do_action("chooseAction")<CR>]], opts)
vim.keymap.set({ "n" }, "<Cr>", [[<Cmd>call ddu#ui#do_action("itemAction")<CR>]], opts)
vim.keymap.set({ "n" }, "<C-v>", [[<Cmd>call ddu#ui#do_action("itemAction", {'params': {'command': 'vsplit'}})<CR>]], opts)
vim.keymap.set({ "n" }, "<C-x>", [[<Cmd>call ddu#ui#do_action("itemAction", {'params': {'command': 'split'}})<CR>]], opts)
vim.keymap.set({ "n" }, "i", [[<Cmd>call ddu#ui#do_action("openFilterWindow")<CR>]], opts)
vim.keymap.set({ "n" }, "P", [[<Cmd>call ddu#ui#do_action("togglePreview")<CR>]], opts)
end,
Expand All @@ -219,7 +222,7 @@ require('packer').startup(function(use)
})

vim.keymap.set("n", "<Space>ff", "<Cmd>call ddu#start(#{name:'file_recursive'})<CR>")
vim.keymap.set("n", "<Space>g", "<Cmd>call ddu#start(#{name:'grep'})<CR>")
vim.keymap.set("n", "<Space>g", "<Cmd>call ddu#start(#{name:'grep', sources: [#{ name: 'rg', params: #{ input: expand('<cword>') } }]})<CR>")
end,
}

Expand Down

0 comments on commit b68b828

Please sign in to comment.