Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggling harpoon list should highlight current file #384

Open
catgoose opened this issue Dec 6, 2023 · 6 comments
Open

Toggling harpoon list should highlight current file #384

catgoose opened this issue Dec 6, 2023 · 6 comments

Comments

@catgoose
Copy link

catgoose commented Dec 6, 2023

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.

@lpanebr
Copy link

lpanebr commented Jan 2, 2024

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.

@kimabrandt-flx
Copy link

Check it out :) #574

@pockata
Copy link
Contributor

pockata commented May 2, 2024

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.

@catgoose
Copy link
Author

catgoose commented May 2, 2024

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!

@bprb
Copy link

bprb commented Sep 8, 2024

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("\\", "\\\\")

@pockata
Copy link
Contributor

pockata commented Oct 5, 2024

Thanks, I had that in my original version for Harpoon 1, but it seems it got lost in the transition.
I've added it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants