mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-26 13:21:45 +00:00
harpoon install telescope ui
This commit is contained in:
parent
59757b77ea
commit
c3aa10fb2e
@ -3,5 +3,35 @@ return {
|
|||||||
branch = 'harpoon2',
|
branch = 'harpoon2',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
},
|
},
|
||||||
|
config = function()
|
||||||
|
local harpoon = require 'harpoon'
|
||||||
|
harpoon:setup {}
|
||||||
|
|
||||||
|
-- basic telescope configuration
|
||||||
|
local conf = require('telescope.config').values
|
||||||
|
local function toggle_telescope(harpoon_files)
|
||||||
|
local file_paths = {}
|
||||||
|
for _, item in ipairs(harpoon_files.items) do
|
||||||
|
table.insert(file_paths, item.value)
|
||||||
|
end
|
||||||
|
|
||||||
|
require('telescope.pickers')
|
||||||
|
.new({}, {
|
||||||
|
prompt_title = 'Harpoon',
|
||||||
|
finder = require('telescope.finders').new_table {
|
||||||
|
results = file_paths,
|
||||||
|
},
|
||||||
|
previewer = conf.file_previewer {},
|
||||||
|
sorter = conf.generic_sorter {},
|
||||||
|
})
|
||||||
|
:find()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Open harpoon list window
|
||||||
|
vim.keymap.set('n', '<leader>ho', function()
|
||||||
|
toggle_telescope(harpoon:list())
|
||||||
|
end, { desc = '[H]arpoon [Open]' })
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user