harpoon icon indicating copy to clipboard operation
harpoon copied to clipboard

Toggling harpoon list should highlight current file

Open catgoose opened this issue 1 year ago • 5 comments

If you have 5 files in the harpoon list and you have file 4 selected, it would be nice if when toggling harpoon list open, file 4 is highlighted instead of the first one.

This would make it easy to open list, go down one or two items then select that one.

If the buffer in the current window is not in harpoon list, then highlight the first item.

catgoose avatar Dec 06 '23 14:12 catgoose

That would indeed be very helpful! It would allow one blindly remove a file: open menu, dd, close menu. It would be a harpoon-style precise operation.

lpanebr avatar Jan 02 '24 21:01 lpanebr

Check it out :) #574

kimabrandt-flx avatar Apr 11 '24 22:04 kimabrandt-flx

I've created a small plugin that adds this functionality. The actual code is so small that you can copy it to your config and save yourself a dependency.

pockata avatar May 02 '24 07:05 pockata

I've created a small plugin that adds this functionality. The actual code is so small that you can copy it to your config and save yourself a dependency.

Thanks, I love it!

catgoose avatar May 02 '24 13:05 catgoose

Nice, thanks!

Quick tip, on Windows, add a backslash escape to make sure files in child directories are highlighted:

local current = Path:new(ctx.current_file)
	:make_relative(vim.uv.cwd())
	:gsub("\\", "\\\\")

bprb avatar Sep 08 '24 03:09 bprb