nvim: remove grep_string and improve telescope config

This commit is contained in:
Primrose 2025-07-07 23:51:29 +02:00
parent 1f26dcd590
commit ba4136ea4c
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -20,10 +20,13 @@ telescope.setup {
mappings = { mappings = {
n = { n = {
["<C-c>"] = actions.close, ["<C-c>"] = actions.close,
["r"] = actions.to_fuzzy_refine,
["j"] = actions.move_selection_next,
["k"] = actions.move_selection_previous,
}, },
i = { i = {
["<C-Up>"] = actions.cycle_history_prev, ["<Up>"] = actions.cycle_history_prev,
["<C-Down>"] = actions.cycle_history_next, ["<Down>"] = actions.cycle_history_next,
}, },
}, },
layout_config = { height = 0.4 }, layout_config = { height = 0.4 },
@ -34,7 +37,7 @@ telescope.setup {
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
}, },
current_buffer_fuzzy_find = { current_buffer_fuzzy_find = {
layout_config = { height = 0.8 }, layout_config = { height = 0.6 },
mappings = { mappings = {
n = { n = {
["n"] = actions.move_selection_next, ["n"] = actions.move_selection_next,
@ -43,15 +46,11 @@ telescope.setup {
}, },
}, },
lsp_references = { lsp_references = {
layout_config = { height = 0.8 }, layout_config = { height = 0.6 },
initial_mode = "normal", initial_mode = "normal",
}, },
live_grep = { live_grep = {
layout_config = { height = 0.8 }, layout_config = { height = 0.6 },
},
grep_string = {
layout_config = { height = 0.8 },
initial_mode = "normal",
}, },
resume = { resume = {
initial_mode = "normal", initial_mode = "normal",
@ -84,8 +83,7 @@ vim.keymap.set("n", "N", cached_buffer_picker)
vim.keymap.set("n", "<leader>/", builtin["find_files"]) vim.keymap.set("n", "<leader>/", builtin["find_files"])
vim.keymap.set("n", "<leader>?", builtin["help_tags"]) vim.keymap.set("n", "<leader>?", builtin["help_tags"])
vim.keymap.set("n", "<leader>g/", builtin["live_grep"]) vim.keymap.set("n", "<leader>g/", function() builtin["live_grep"] { default_text = vim.fn.expand("<cword>") } end)
vim.keymap.set("n", "<leader>gw", builtin["grep_string"]) -- greps current word under cursor
vim.keymap.set("n", "<leader>d", builtin["diagnostics"]) vim.keymap.set("n", "<leader>d", builtin["diagnostics"])
vim.keymap.set("n", "<leader>b", builtin["buffers"]) vim.keymap.set("n", "<leader>b", builtin["buffers"])
vim.keymap.set("n", "<leader>sp", builtin["spell_suggest"]) vim.keymap.set("n", "<leader>sp", builtin["spell_suggest"])