From b7975c5aabd6e8ff3490f0614dad15b20a94947c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Sat, 27 Jul 2024 18:50:04 +0200 Subject: [PATCH] nixvim(telescope): reorganise keymaps into categories, fix leader+f => leader + ff, close telescope on esc in insert mode --- nixvim/config/telescope.nix | 39 ++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/nixvim/config/telescope.nix b/nixvim/config/telescope.nix index 980a6ca..c6505e5 100644 --- a/nixvim/config/telescope.nix +++ b/nixvim/config/telescope.nix @@ -1,37 +1,50 @@ { plugins.telescope = { enable = true; + settings.defaults.mappings = { + i = { + # close telescope when escape pressed in insert mode + "" = "close"; + }; + }; keymaps = { + # files "" = { action = "find_files"; options = { desc = "Find files in current directory"; }; }; - "f" = { + "ff" = { action = "find_files"; options = { desc = "Find files in current directory"; }; }; - "/" = { - action = "live_grep"; - options = { - desc = "Grep (root dir)"; - }; - }; - "b" = { - action = "buffers"; - options = { - desc = "Buffer list"; - }; - }; "fr" = { action = "oldfiles"; options = { desc = "Recent files"; }; }; + + # search + "/" = { + action = "live_grep"; + options = { + desc = "Grep (root dir)"; + }; + }; + + # buffers + "b" = { + action = "buffers"; + options = { + desc = "Buffer list"; + }; + }; + + # lsp "sD" = { action = "diagnostics"; options = {