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

feat(esupports.hop): Add tab drop as option for open_mode #1580

Merged
merged 6 commits into from
Nov 16, 2024

Conversation

devansh08
Copy link
Contributor

This adds :tab drop as an option for opening a file when clicking a file link. Tab drop as an option would be helpful to avoid opening a file a new tab, when it has already been open somewhere else.

IMO, this could be a replacement for the tabnew option itself, as tab drop will open a new tab normally if the same file is already not open. But it can be kept as a separate option as well. Also IMO, never bad to have multiple options :)

Do let me know your thoughts on this. If this looks good and needs any documenting, happy to work on that as well.

Thanks!

Copy link
Contributor

@benlubas benlubas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice qol change.

It doesn't work currently, after that's fixed, you can rebase off of main (there was a documentation PR merged just now) and document the keybind with the others.

lua/neorg/modules/core/esupports/hop/module.lua Outdated Show resolved Hide resolved
@devansh08 devansh08 reopened this Nov 1, 2024
@devansh08
Copy link
Contributor Author

@benlubas Fixed the mentioned issue and added docs.
I accidentally broke my git while trying to rebase, so had to commit my changes again. My bad!

Let me know if the docs part is good. Could not think of any better keybind using CR, so went with C-t. Let me know if you have any better ideas for that.

Thanks!

@devansh08
Copy link
Contributor Author

I've just added another similar option that uses :drop instead. This works similar to tab-drop but would be useful for a buffer focused workflow (to which I have recently switched over :)). So cases where you have the destination already open in a split, it would just navigate to that instead of opening the destination in the current buffer (what default hop does today).

Let me know your thoughts. Thanks!

Copy link
Contributor

@benlubas benlubas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs look good, but we can't override <C-d> that's a default vim bind.

lua/neorg/modules/core/keybinds/module.lua Outdated Show resolved Hide resolved
@benlubas benlubas merged commit c7ada78 into nvim-neorg:main Nov 16, 2024
4 of 6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants