added zoxide into telescope <leader>sD
This commit is contained in:
parent
d5c8002ff8
commit
0eb0359cee
4 changed files with 165 additions and 4 deletions
48
lua/custom/plugins/zoxide-telescope.lua
Normal file
48
lua/custom/plugins/zoxide-telescope.lua
Normal 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,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue