Improve <leader>? keybind search

This commit is contained in:
2026-07-10 16:21:34 -07:00
parent f318cd953f
commit c6c51c81ef
5 changed files with 33 additions and 37 deletions
+2 -2
View File
@@ -24,6 +24,7 @@ Lua config managed by [lazy.nvim](https://github.com/folke/lazy.nvim). Leader is
- `<leader>;` — jump to buffer - `<leader>;` — jump to buffer
- `<leader>be` — jump to buffer, sorted by most recently used - `<leader>be` — jump to buffer, sorted by most recently used
- `<leader>ag` — live grep - `<leader>ag` — live grep
- `<leader>?` — fuzzy-search all keybindings
- **[flash.nvim](https://github.com/folke/flash.nvim)** — jump to any visible location via search-like labels - **[flash.nvim](https://github.com/folke/flash.nvim)** — jump to any visible location via search-like labels
- `<leader>/` — jump - `<leader>/` — jump
- `<leader>s` — search jump - `<leader>s` — search jump
@@ -125,8 +126,7 @@ LSP buffer keymaps (set on `LspAttach`, see `plugins/lsp.lua`):
- `<leader>u` — toggle - `<leader>u` — toggle
- **[persistence.nvim](https://github.com/folke/persistence.nvim)** — session save/restore per project - **[persistence.nvim](https://github.com/folke/persistence.nvim)** — session save/restore per project
- restore from the dashboard's `s` button - restore from the dashboard's `s` button
- **[which-key.nvim](https://github.com/folke/which-key.nvim)** — keybinding cheatsheet, built from every mapping's `desc` - **[which-key.nvim](https://github.com/folke/which-key.nvim)** — shows available keybindings as you type a prefix (e.g. pause after `<leader>`), automatic
- `<leader>?` — browse all keybindings; press a key to drill into a group, `<bs>` to go back up, `<esc>` to close
## Dashboard ## Dashboard
+4 -2
View File
@@ -7,7 +7,7 @@
"claudecode.nvim": { "branch": "main", "commit": "2390c6e45c4789072c293ac69de051d169668b29" }, "claudecode.nvim": { "branch": "main", "commit": "2390c6e45c4789072c293ac69de051d169668b29" },
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
"emmet-vim": { "branch": "master", "commit": "92ef2f74f4093edc99db5e9e4cf7e40116a85bd6" }, "emmet-vim": { "branch": "master", "commit": "92ef2f74f4093edc99db5e9e4cf7e40116a85bd6" },
"flash.nvim": { "branch": "main", "commit": "b6346946d10d07998efee029fb0f7a593806d0cd" }, "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
"gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" }, "gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" },
"gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" }, "gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" },
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
@@ -21,8 +21,10 @@
"neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
"nvim-dap": { "branch": "master", "commit": "9e848e09a697ee95302a3ef2dd43fd6eb709e570" },
"nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" },
"nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" }, "nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" },
"nvim-lspconfig": { "branch": "master", "commit": "d6ac7a0d46555d44bf21f4f9c65f5201f818b475" }, "nvim-lspconfig": { "branch": "master", "commit": "d224a1920728ba129880efc700d4a0180ac4ecbb" },
"nvim-surround": { "branch": "main", "commit": "8b47db616ef658b8fc27e61db2896aa2f40134de" }, "nvim-surround": { "branch": "main", "commit": "8b47db616ef658b8fc27e61db2896aa2f40134de" },
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
"nvim-treesitter-context": { "branch": "master", "commit": "b311b30818951d01f7b4bf650521b868b3fece16" }, "nvim-treesitter-context": { "branch": "master", "commit": "b311b30818951d01f7b4bf650521b868b3fece16" },
+26 -26
View File
@@ -1,55 +1,55 @@
local map = vim.keymap.set local map = vim.keymap.set
-- Insert/command-mode escape via ,, -- Insert/command-mode escape via ,,
map("i", ",,", "<Esc>") map("i", ",,", "<Esc>", { desc = "Escape insert mode" })
map("c", ",,", "<Esc><Esc>") map("c", ",,", "<Esc><Esc>", { desc = "Escape command mode" })
-- Move by display line, not physical line -- Move by display line, not physical line
map("n", "j", "gj") map("n", "j", "gj", { desc = "Move down by display line" })
map("n", "k", "gk") map("n", "k", "gk", { desc = "Move up by display line" })
-- Clear search highlight -- Clear search highlight
map("n", "<leader><leader><Esc>", ":nohl<CR>") map("n", "<leader><leader><Esc>", ":nohl<CR>", { desc = "Clear search highlight" })
-- Hex mode -- Hex mode
map("n", "<leader>\\he", ":%!xxd<CR>") map("n", "<leader>\\he", ":%!xxd<CR>", { desc = "Hex dump buffer" })
map("n", "<leader>\\hd", ":%!xxd -r<CR>") map("n", "<leader>\\hd", ":%!xxd -r<CR>", { desc = "Undo hex dump" })
-- Toggle whitespace display -- Toggle whitespace display
map("n", "<leader><leader>lw", ":set list!<CR>") map("n", "<leader><leader>lw", ":set list!<CR>", { desc = "Toggle whitespace display" })
-- List registers / marks -- List registers / marks
map("n", "<leader><leader>lr", ":reg<CR>") map("n", "<leader><leader>lr", ":reg<CR>", { desc = "List registers" })
map("n", "<leader><leader>lm", ":marks<CR>") map("n", "<leader><leader>lm", ":marks<CR>", { desc = "List marks" })
-- Prev/next buffer -- Prev/next buffer
map("n", "<leader>q", ":bp<CR>") map("n", "<leader>q", ":bp<CR>", { desc = "Previous buffer" })
map("n", "<leader>w", ":bn<CR>") map("n", "<leader>w", ":bn<CR>", { desc = "Next buffer" })
-- System clipboard -- System clipboard
map({ "n", "v" }, "<leader>y", '"+y') map({ "n", "v" }, "<leader>y", '"+y', { desc = "Yank to system clipboard" })
map({ "n", "v" }, "<leader>Y", '"+Y') map({ "n", "v" }, "<leader>Y", '"+Y', { desc = "Yank line to system clipboard" })
map({ "n", "v" }, "<leader>p", '"+p') map({ "n", "v" }, "<leader>p", '"+p', { desc = "Paste from system clipboard" })
map({ "n", "v" }, "<leader>P", '"+P') map({ "n", "v" }, "<leader>P", '"+P', { desc = "Paste before from system clipboard" })
map({ "n", "v" }, "<leader>x", '"+x') map({ "n", "v" }, "<leader>x", '"+x', { desc = "Cut to system clipboard" })
map("n", "<leader>dd", '"+dd') map("n", "<leader>dd", '"+dd', { desc = "Delete line to system clipboard" })
-- Make split -- Make split
map("n", "<leader>-", ":sp<Space>") map("n", "<leader>-", ":sp<Space>", { desc = "Horizontal split" })
map("n", "<leader><Bar>", ":vsp<Space>") map("n", "<leader><Bar>", ":vsp<Space>", { desc = "Vertical split" })
-- Open init.lua -- Open init.lua
map("n", "<leader>v", ":e $MYVIMRC<CR>") map("n", "<leader>v", ":e $MYVIMRC<CR>", { desc = "Edit init.lua" })
-- Low-light / daylight mode -- Low-light / daylight mode
map("n", "<leader><leader>ll", ":set background=dark<CR>") map("n", "<leader><leader>ll", ":set background=dark<CR>", { desc = "Dark background" })
map("n", "<leader><leader>LL", ":set background=light<CR>") map("n", "<leader><leader>LL", ":set background=light<CR>", { desc = "Light background" })
-- Ranger / trailing whitespace utilities -- Ranger / trailing whitespace utilities
map("n", "<leader>ra", function() require("util").ranger() end) map("n", "<leader>ra", function() require("util").ranger() end, { desc = "Open ranger" })
map("n", "<leader>rw", function() require("util").delete_trailing_ws() end) map("n", "<leader>rw", function() require("util").delete_trailing_ws() end, { desc = "Delete trailing whitespace" })
-- Terminal-mode Ctrl-Z otherwise goes straight to the embedded process (e.g. -- Terminal-mode Ctrl-Z otherwise goes straight to the embedded process (e.g.
-- suspending the claude CLI inside claudecode.nvim's terminal with no way to -- suspending the claude CLI inside claudecode.nvim's terminal with no way to
-- fg it back) instead of suspending Neovim itself, like Ctrl-Z does by -- fg it back) instead of suspending Neovim itself, like Ctrl-Z does by
-- default in Normal mode. -- default in Normal mode.
map("t", "<C-z>", "<C-\\><C-n><C-z>") map("t", "<C-z>", "<C-\\><C-n><C-z>", { desc = "Suspend Neovim" })
+1
View File
@@ -38,6 +38,7 @@ return {
desc = "Jump to buffer (MRU)", desc = "Jump to buffer (MRU)",
}, },
{ "<leader>ag", "<cmd>Telescope live_grep<CR>", desc = "Grep" }, { "<leader>ag", "<cmd>Telescope live_grep<CR>", desc = "Grep" },
{ "<leader>?", "<cmd>Telescope keymaps<CR>", desc = "Search keybindings" },
}, },
config = function() config = function()
local telescope = require("telescope") local telescope = require("telescope")
-7
View File
@@ -27,12 +27,5 @@ return {
"folke/which-key.nvim", "folke/which-key.nvim",
event = "VeryLazy", event = "VeryLazy",
opts = {}, opts = {},
keys = {
{
"<leader>?",
function() require("which-key").show({ global = true }) end,
desc = "Keybinding cheatsheet",
},
},
}, },
} }