diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 5b4035d..b4d12c6 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -8,10 +8,3 @@ vim.keymap.set('n', '', 'j') vim.keymap.set('n', '', 'k') vim.keymap.set('n', '', 'h') vim.keymap.set('n', '', 'l') - --- telescope keymaps -local builtin = require('telescope.builtin') -vim.keymap.set('n', 'ff', builtin.find_files, {}) -vim.keymap.set('n', 'fg', builtin.live_grep, {}) -vim.keymap.set('n', 'fb', builtin.buffers, {}) -vim.keymap.set('n', 'fh', builtin.help_tags, {}) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index be4e2bc..5b37382 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,5 +1,25 @@ return { - 'nvim-telescope/telescope.nvim', tag = '0.1.8', - - dependencies = { 'nvim-lua/plenary.nvim' } + 'nvim-telescope/telescope.nvim', + cmd = 'Telescope', + dependencies = { + 'nvim-lua/plenary.nvim' + }, + keys = function() + local lazy_telescope = function(builtin) + return function(...) + require('telescope.builtin')[builtin](...) + end + end + return { + { 'fb', lazy_telescope('buffers'), desc = 'Find buffers' }, + { 'fd', lazy_telescope('diagnostics'), desc = 'Find diagnostics' }, + { 'ff', lazy_telescope('find_files'), desc = 'Find files' }, + { 'fg', lazy_telescope('live_grep'), desc = 'Find files by content'}, + { 'fh', lazy_telescope('help_tags'), desc = 'Find help tags' }, + { 'fo', lazy_telescope('oldfiles'), desc = 'Find recently opened files' }, + { 'fw', lazy_telescope('grep_string'), desc = 'Find word in buffer' }, + { 'f/', lazy_telescope('current_buffer_fuzzy_find'), desc = 'Find fuzzy match in current buffer' }, + } + end, + config = true, }