feature: fzf-lua support #36

Closed
opened 2026-01-22 02:19:36 -06:00 by Michaelpalacce · 3 comments
Michaelpalacce commented 2026-01-22 02:19:36 -06:00 (Migrated from github.com)

Did you check the docs?

  • I have read all the haunt.nvim docs

I saw it's in the roadmap, wanted to share a snippet if it may be of help. Great tool!

Describe the solution you'd like


Describe alternatives/other solutions you've considered


Additional context

Did you check the docs?

  • I have read all the haunt.nvim docs

I think this is already planned, just wanted to share some code if it may help

Describe the solution you'd like


Describe alternatives/other solutions you've considered


Additional context

Here's a snippet. Works for me:

			local function haunt_fzf_picker()
				local fzf = require('fzf-lua')
				local haunt = require('haunt.api')
				local bookmarks = haunt.get_bookmarks()

				local display_list = {}
				local lookup = {} -- So we don't have to parse string later

				for _, b in ipairs(bookmarks) do
					local label = string.format("%s:%d:%d │ %s",
						b.file, b.line, b.col or 1, b.note or "")
					table.insert(display_list, label)
					lookup[label] = b
				end

				fzf.fzf_exec(display_list, {
					prompt = 'Boo> ', -- Can be changed if you fanceh
					previewer = 'builtin', -- This makes it so we have preview, can be removed
					actions = {
						['default'] = function(selected)
							local entry = selected[1]
							local data = lookup[entry]

							if data then -- Open the file
								vim.cmd("edit " .. vim.fn.fnameescape(data.file))
								vim.api.nvim_win_set_cursor(0, { data.line, data.col or 0 })
							end
						end
					}
				})
			end

			-- picker (but not snacks)
			map("n", prefix .. "l", function()
				haunt_fzf_picker()
			end, { desc = "Show Picker" })
### Did you check the docs? - [x] I have read all the haunt.nvim docs ### Is your feature request related to a problem? Please describe. I saw it's in the roadmap, wanted to share a snippet if it may be of help. Great tool! ### Describe the solution you'd like --- ### Describe alternatives/other solutions you've considered --- ### Additional context ### Did you check the docs? - [x] I have read all the haunt.nvim docs ### Is your feature request related to a problem? Please describe. I think this is already planned, just wanted to share some code if it may help ### Describe the solution you'd like --- ### Describe alternatives/other solutions you've considered --- ### Additional context Here's a snippet. Works for me: ```lua local function haunt_fzf_picker() local fzf = require('fzf-lua') local haunt = require('haunt.api') local bookmarks = haunt.get_bookmarks() local display_list = {} local lookup = {} -- So we don't have to parse string later for _, b in ipairs(bookmarks) do local label = string.format("%s:%d:%d │ %s", b.file, b.line, b.col or 1, b.note or "") table.insert(display_list, label) lookup[label] = b end fzf.fzf_exec(display_list, { prompt = 'Boo> ', -- Can be changed if you fanceh previewer = 'builtin', -- This makes it so we have preview, can be removed actions = { ['default'] = function(selected) local entry = selected[1] local data = lookup[entry] if data then -- Open the file vim.cmd("edit " .. vim.fn.fnameescape(data.file)) vim.api.nvim_win_set_cursor(0, { data.line, data.col or 0 }) end end } }) end -- picker (but not snacks) map("n", prefix .. "l", function() haunt_fzf_picker() end, { desc = "Show Picker" }) ```
Owner

This will make my life much easier! Thanks

This will make my life much easier! Thanks
Owner

@Michaelpalacce

This feature is now implemented. You can use the fzf option instead. checkout the new readme!

Thank you for opening this. really made things easier.

@Michaelpalacce This feature is now implemented. You can use the fzf option instead. checkout the new readme! Thank you for opening this. really made things easier.
Michaelpalacce commented 2026-01-24 15:49:40 -06:00 (Migrated from github.com)

Awesome! Can't wait to try it out! Great work on the plugin 🎉

Awesome! Can't wait to try it out! Great work on the plugin 🎉
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
noe.trevino/haunt.nvim#36
No description provided.