added zoxide into telescope <leader>sD

This commit is contained in:
Wellinton Aracena 2024-03-05 21:14:50 -05:00
parent d5c8002ff8
commit 0eb0359cee
4 changed files with 165 additions and 4 deletions

View file

@ -0,0 +1,48 @@
-- Useful for easily creating commands
return {
{
'nvim-lua/popup.nvim',
},
{
'nvim-telescope/telescope.nvim',
},
{
'jvgrootveld/telescope-zoxide',
config = function()
local t = require 'telescope'
local z_utils = require 'telescope._extensions.zoxide.utils'
-- Configure the extension
t.setup {
extensions = {
zoxide = {
prompt_title = '[ Walking on the shoulders of TJ ]',
mappings = {
default = {
after_action = function(selection)
print('Update to (' .. selection.z_score .. ') ' .. selection.path)
end,
},
['<C-s>'] = {
before_action = function(selection)
print 'before C-s'
end,
action = function(selection)
vim.cmd.edit(selection.path)
end,
},
['<C-q>'] = { action = z_utils.create_basic_command 'split' },
},
},
},
}
-- Load the extension
t.load_extension 'zoxide'
-- Add a mapping
vim.keymap.set('n', '<leader>sD', t.extensions.zoxide.list, { desc = 'zoxide search' })
end,
},
}