diff --git a/init.lua b/init.lua index a5ee785..b37c71f 100644 --- a/init.lua +++ b/init.lua @@ -394,7 +394,18 @@ require("which-key").add ({ -- This does not allow you to make a new file only search existing, but good enough for now. --{ "", "Telescope find_files find_command=rg,--ignore,--hidden,--files" , desc = "Find File", mode = "n" }, - { "", function() Snacks.picker.files() end, desc = "Find File", mode = "n" }, + { "", function() Snacks.picker.explorer({ + layout = "ivy", + focus = "input", + win = { + input = { + keys = { + [""] = { "focus_list", mode = { "i", "n" } }, + [""] = { "focus_list", mode = { "i", "n" } }, + } + }, + }, + }) end, desc = "Find File", mode = "n" }, --{ "f", "Telescope file_browser" , desc = "File Browser", mode = "n" }, diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua index 4089ae2..6fa1e79 100644 --- a/lua/plugins/snacks.lua +++ b/lua/plugins/snacks.lua @@ -11,7 +11,20 @@ return { dashboard = { enabled = false }, explorer = { enabled = false }, indent = { enabled = false }, - input = { enabled = true }, + input = { + enabled = true, + keys = { + n_cancel = { "", { "cmp_close", "cancel" }, mode = { "i", "n" }, expr = true }, + n_esc = { "", { "cmp_close", "cancel" }, mode = "n", expr = true }, + i_esc = { "", { "cmp_close", "stopinsert" }, mode = "i", expr = true }, + i_cr = { "", { "cmp_accept", "confirm" }, mode = { "i", "n" }, expr = true }, + i_tab = { "", { "cmp_select_next", "cmp" }, mode = "i", expr = true }, + i_ctrl_w = { "", "", mode = "i", expr = true }, + i_up = { "", { "hist_up" }, mode = { "i", "n" } }, + i_down = { "", { "hist_down" }, mode = { "i", "n" } }, + q = "cancel", + }, + }, picker = { enabled = true, layout = "ivy",