Add descriptions to telescope keymaps and removed viml, change style of colorscheme selection

This commit is contained in:
Fabian Schmidt 2024-09-17 16:13:48 +02:00
parent 8b714fabfa
commit e3762ced4e

View File

@ -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", "<leader>gh", require("telescope.builtin").git_bcommits, opts)
vim.keymap.set("n", "<leader>gb", require("telescope.builtin").git_branches, opts)
vim.keymap.set("n", "<leader>gs", require("telescope.builtin").git_status, opts)
vim.keymap.set('n', '<Leader>ff', '<cmd>lua require(\'telescope.builtin\').git_files()<CR>', opts)
vim.keymap.set('n', '<Leader>fg', '<cmd>lua require(\'telescope.builtin\').live_grep()<CR>', opts)
vim.keymap.set('n', '<Leader>fb', '<cmd>lua require(\'telescope.builtin\').buffers()<CR>', opts)
vim.keymap.set('n', '<Leader>fh', '<cmd>lua require(\'telescope.builtin\').help_tags()<CR>', opts)
vim.keymap.set('n', '<leader>cc', '<cmd>Telescope colorscheme<CR>')
local telescope = require("telescope.builtin")
local wk = require("which-key")
wk.add({
{ "<leader>gh", telescope.git_bcommits, { noremap = true, silent = true, group = "git", desc = "View commits of current buffer" } },
{ "<leader>gb", telescope.git_branches, { noremap = true, silent = true, group = "git", desc = "View git branches" } },
{ "<leader>gs", telescope.git_status, { noremap = true, silent = true, group = "git", desc = "View git status" } },
{ '<Leader>ff', telescope.git_files, { noremap = true, silent = true, desc = "Search files" } },
{ '<Leader>fg', telescope.live_grep, { noremap = true, silent = true, desc = "Search in files" } },
{ '<Leader>fb', telescope.buffers, { noremap = true, silent = true, desc = "Search in buffers" } },
{ '<Leader>fh', telescope.help_tags, { noremap = true, silent = true, desc = "Search in help" } },
{ '<leader>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 = {
["<C-h>"] = "which_key"
}
}
},
pickers = {
colorscheme = {
theme = "dropdown"
}
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown()
require("telescope.themes").get_cursor()
}
}
}