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

[Feature] External editor mode in pattern editor #2179

Open
1 task
sevenc-nanashi opened this issue Mar 22, 2025 · 2 comments
Open
1 task

[Feature] External editor mode in pattern editor #2179

sevenc-nanashi opened this issue Mar 22, 2025 · 2 comments

Comments

@sevenc-nanashi
Copy link

What feature would you like to see?

I mainly use Neovim and I really like the vim key bindings.
I really want to use my vim keybindings in ImHex, but I know it's difficult, so it would be good if there's "external editor mode", which does:

  • Create temporary file
  • Opens that file with editor (specified by user)
  • Watch that file for reloading

How will this feature be useful to you and others?

I can use vim key bindings, cursor users can use AIs, Copilot users can use Copilot, and so on.

Request Type

  • I can provide a PoC for this feature or am willing to work on it myself and submit a PR

Additional context?

N/A

@paxcut
Copy link
Contributor

paxcut commented Mar 22, 2025

My guess is that you are asking about adding external text editors in order to write patterns instead of using the pattern editor. Using an external Hex editor with ImHex doesn't make sense to me so I'll be assuming you mean text editors.
I feel that if it were possible to add external text editors it would have been done already since ImHex users have struggled using the Pattern editor which was barely functional when I started using ImHex.

There is one extension written for vscode that allow you to write patterns, bu it is not possible to interact with the environment that ImHex provides outside modules that are linked against ImHex.

As time progresses, the Pattern editor is becoming more and more useful. For example a fairly complete set of customizable basic text editor key bindings were added so it may be possible to use some of vim key binds in the Pattern editor. Then again, if vim is anything like emacs (and I suspect it can be even more complex), then the simple editor actions that are available may not even scratch the surface of the ones you may possibly need/wish for.

Still I feel that a better approach would be to make requests for actions with key binds that can be customized to be added to the Pattern editor than request entire editors to be somehow integrated into ImHex. With that in mind I refer you to the settings in ImHex where you will find the shortcut manager which lists all the available action and lets you define key binds to execute them. As vim may have hundreds of key binds it would be impossible to implement them all, but it is possible that you are only interested in a small subset of them and that may be more feasible. When I say action I obviously mean actions found in text editors only. It is not possible for the pattern editor to execute a perl script or to perform json queries.

@sevenc-nanashi sevenc-nanashi changed the title [Feature] External editor mode [Feature] External editor mode in pattern editor Mar 22, 2025
@sevenc-nanashi
Copy link
Author

sevenc-nanashi commented Mar 22, 2025

First of all, I added "in pattern editor" to the title (sorry for confusion).

Supporting vim keybindings is something like rewriting entire pattern editor; Vim has a concept of modes (Normal, Insert, visual, and so on), extensible scripts (Scripts include custom mapping), and more.
I feel like every vim user has their own customized vim/neovim, and not few of them would like to use that bindings on every text input (including here).

I think, supporting vim keybindings natively (like Obsidian), is very difficult and the issue will be filled by "I'm vim user, and this vim keybinding is not working like vim".

Thus, I feel it's better to add "external editor mode", than supporting vim keybindings.

(fyi if you have Linux environment or WSL, you can start "vimtutor" and understand how difficult supporting vim keybindings is)

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

No branches or pull requests

2 participants