diff --git a/lua/plugins/navigation.lua b/lua/plugins/navigation.lua index b41d3a0..bd4e019 100644 --- a/lua/plugins/navigation.lua +++ b/lua/plugins/navigation.lua @@ -4,15 +4,18 @@ return { version = '0.1.*', dependencies = { 'nvim-lua/plenary.nvim' }, config = function() - local opts = { noremap = true, silent = true } - vim.keymap.set("n", "gh", require("telescope.builtin").git_bcommits, opts) - vim.keymap.set("n", "gb", require("telescope.builtin").git_branches, opts) - vim.keymap.set("n", "gs", require("telescope.builtin").git_status, opts) - vim.keymap.set('n', 'ff', 'lua require(\'telescope.builtin\').git_files()', opts) - vim.keymap.set('n', 'fg', 'lua require(\'telescope.builtin\').live_grep()', opts) - vim.keymap.set('n', 'fb', 'lua require(\'telescope.builtin\').buffers()', opts) - vim.keymap.set('n', 'fh', 'lua require(\'telescope.builtin\').help_tags()', opts) - vim.keymap.set('n', 'cc', 'Telescope colorscheme') + local telescope = require("telescope.builtin") + local wk = require("which-key") + wk.add({ + { "gh", telescope.git_bcommits, { noremap = true, silent = true, group = "git", desc = "View commits of current buffer" } }, + { "gb", telescope.git_branches, { noremap = true, silent = true, group = "git", desc = "View git branches" } }, + { "gs", telescope.git_status, { noremap = true, silent = true, group = "git", desc = "View git status" } }, + { 'ff', telescope.git_files, { noremap = true, silent = true, desc = "Search files" } }, + { 'fg', telescope.live_grep, { noremap = true, silent = true, desc = "Search in files" } }, + { 'fb', telescope.buffers, { noremap = true, silent = true, desc = "Search in buffers" } }, + { 'fh', telescope.help_tags, { noremap = true, silent = true, desc = "Search in help" } }, + { 'cc', telescope.colorscheme, { desc = "Select colorscheme" } }, + }) end }, { @@ -20,9 +23,21 @@ return { dependencies = { 'nvim-telescope/telescope.nvim' }, config = function() require("telescope").setup { + defaults = { + mappings = { + i = { + [""] = "which_key" + } + } + }, + pickers = { + colorscheme = { + theme = "dropdown" + } + }, extensions = { ["ui-select"] = { - require("telescope.themes").get_dropdown() + require("telescope.themes").get_cursor() } } }