From 9a874b1a1b03cf488cfea6ee36be0fdf8d686dd8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 24 Feb 2023 21:38:31 +0100 Subject: [PATCH] nvim: Remap leader groups This commit is a change to some of the foundational mappings I use through my leader key: opening telescope searches and toggling several additional display riders. First of all, all telescope functionality has been subsumed under the f prefix: f (ff, that is) for finding files F for grepping h for finding hidden files o for finding old files b for finding buffers l for searching git log s for searching git status c for finding git commits (for current file) Aside from these (which are pretty massive changes for me), we have a new leader prefix group for the (now freed) s: o toggle symbols outline m toggle minimap s open the (mini.nvim) startup screen --- nvim/.config/nvim/lua/maps.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index 5a3f663..ccfd6d2 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -116,33 +116,33 @@ map('n', 'E', ':Vifm getcwd()', { desc = 'browse project' }) -- PLUGIN: Telescope GLOBAL FUZZY FINDING -- buffers and files in current workdir -map('n', 's', +map('n', 'fb', ":lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())", { desc = 'list buffers' }) -- most recently used / MRU, bound to S since it is essentially a larger -- go-back intention than just buffers -map('n', 'S', +map('n', 'fo', ":lua require 'telescope.builtin'.oldfiles(require 'telescope.themes'.get_ivy())", { desc = 'list old files' }) -- fuzzy find files in cwd -map('n', 'f', ":lua require 'telescope.builtin'.find_files()", +map('n', 'ff', ":lua require 'telescope.builtin'.find_files()", { desc = 'find files' }) -- fuzzy find hidden files in cwd -map('n', '', +map('n', 'fh', ":lua require 'telescope.builtin'.find_files({hidden=true})", { desc = 'find hidden files' }) -- general full-text search in cwd with rg -map('n', 'F', ":lua require 'telescope.builtin'.live_grep()", +map('n', 'fF', ":lua require 'telescope.builtin'.live_grep()", { desc = 'grep search' }) -- git status -map('n', 'gs', ":lua require 'telescope.builtin'.git_status()", +map('n', 'fg', ":lua require 'telescope.builtin'.git_status()", { desc = 'git status' }) -- git buffercommits -map('n', 'gb', ":lua require 'telescope.builtin'.git_bcommits()", +map('n', 'fc', ":lua require 'telescope.builtin'.git_bcommits()", { desc = 'git buffer commits' }) -- git commitlog -map('n', 'gl', ":lua require 'telescope.builtin'.git_commits()", +map('n', 'fl', ":lua require 'telescope.builtin'.git_commits()", { desc = 'git commit log' }) -- helptags @@ -193,7 +193,8 @@ map('i', '', 'u[s1z=`]au') map('n', 's', 'ms[s1z=`s', { desc = 'Fix last spell error' }) -- PLUGIN: mini.nvim -map('n', 'm', ':lua MiniMap.toggle()', { silent = true }) +map('n', 'sm', ':lua MiniMap.toggle()', { silent = true, desc = 'toggle minimap' }) +map('n', 'ss', ":lua MiniStarter.open()", { desc = 'show startpage' }) -- PLUGIN: easy-align -- Start interactive EasyAlign in visual mode (e.g. vipga) @@ -202,7 +203,7 @@ map('x', 'ga', '(EasyAlign)') map('n', 'ga', '(EasyAlign)') -- PLUGIN: symbols-outline.nvim -map('n', 'o', 'SymbolsOutline', { silent = true }) +map('n', 'so', 'SymbolsOutline', { silent = true, desc = 'toggle symbol outline' }) -- trim trailing whitespaces with mini.nvim trailspace map("n", "w", function() require("mini.trailspace").trim() end,