From ba4136ea4c15d751f81f932f3304bf7b0bb6f620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 7 Jul 2025 23:51:29 +0200 Subject: [PATCH] nvim: remove grep_string and improve telescope config --- .config/nvim/after/plugin/telescope.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua index 4427d835..159caeca 100644 --- a/.config/nvim/after/plugin/telescope.lua +++ b/.config/nvim/after/plugin/telescope.lua @@ -20,10 +20,13 @@ telescope.setup { mappings = { n = { [""] = actions.close, + ["r"] = actions.to_fuzzy_refine, + ["j"] = actions.move_selection_next, + ["k"] = actions.move_selection_previous, }, i = { - [""] = actions.cycle_history_prev, - [""] = actions.cycle_history_next, + [""] = actions.cycle_history_prev, + [""] = actions.cycle_history_next, }, }, layout_config = { height = 0.4 }, @@ -34,7 +37,7 @@ telescope.setup { find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, }, current_buffer_fuzzy_find = { - layout_config = { height = 0.8 }, + layout_config = { height = 0.6 }, mappings = { n = { ["n"] = actions.move_selection_next, @@ -43,15 +46,11 @@ telescope.setup { }, }, lsp_references = { - layout_config = { height = 0.8 }, + layout_config = { height = 0.6 }, initial_mode = "normal", }, live_grep = { - layout_config = { height = 0.8 }, - }, - grep_string = { - layout_config = { height = 0.8 }, - initial_mode = "normal", + layout_config = { height = 0.6 }, }, resume = { initial_mode = "normal", @@ -84,8 +83,7 @@ vim.keymap.set("n", "N", cached_buffer_picker) vim.keymap.set("n", "/", builtin["find_files"]) vim.keymap.set("n", "?", builtin["help_tags"]) -vim.keymap.set("n", "g/", builtin["live_grep"]) -vim.keymap.set("n", "gw", builtin["grep_string"]) -- greps current word under cursor +vim.keymap.set("n", "g/", function() builtin["live_grep"] { default_text = vim.fn.expand("") } end) vim.keymap.set("n", "d", builtin["diagnostics"]) vim.keymap.set("n", "b", builtin["buffers"]) vim.keymap.set("n", "sp", builtin["spell_suggest"])