diff --git a/lua/one/plugins/telescope/keymaps.lua b/lua/one/plugins/telescope/keymaps.lua index 6556d2e..7995bbc 100644 --- a/lua/one/plugins/telescope/keymaps.lua +++ b/lua/one/plugins/telescope/keymaps.lua @@ -1,11 +1,12 @@ return function() local util = require('one.util') local tb = require('telescope.builtin') + local te = require('telescope').extensions local opts = { silent = true } local map = { - { 'n', ';', require('telescope').extensions.find_pickers.find_pickers }, + { 'n', ';', te.find_pickers.find_pickers }, { 'n', 'f', ':Telescope find_files', opts }, { 'n', 'n', ':Telescope message', opts }, @@ -50,8 +51,11 @@ return function() { silent = true, desc = 'Fuzzy find content with selection in workspace' }, }, - { 'n', 'p', ':Telescope commands', opts }, - { 'v', 'p', tb.commands, { silent = true, desc = 'List commands with selection' } }, + { 'n', 'p', ':Telescope cmdline', opts }, + { 'v', 'p', function() + local text = util.getVisualSelection() + te.cmdline.cmdline({ default_text = text }) + end, { silent = true, desc = 'List commands with selection' } }, -- Press '' to execute command immediately. -- Press '' to edit command in terminal mode.