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

Translating vim macros to lua functions to enable debugging them #45

Open
matu3ba opened this issue Jul 27, 2022 · 0 comments
Open

Translating vim macros to lua functions to enable debugging them #45

matu3ba opened this issue Jul 27, 2022 · 0 comments
Labels
help wanted Extra attention is needed idea

Comments

@matu3ba
Copy link

matu3ba commented Jul 27, 2022

What?
Debugging vim macros is outright painful, because they may silently abort without knowledge to user where and due to what reasons.
Macros can not be executed step by step, so any workaround would be helpful. The workaround of how to debug vim macros is to translate it into vim functions: "The pain of converting to a function is only worth it if you use it a lot.".
Why not use the simpler language lua instead and automatize the process?
Related discussion.

Why?

  1. Make macros inspectable, reusable and store them as plain lua instead of invalid UTF8.
  2. Semiautomatically generate lua code from key actions.
  3. Generate the lua code from motions on code to generate refactoring snippets to share
  4. (crazy idea) Translate code back to vim motions.

Potential existing implementations:
No, the state of debugging vim macros is poor as can be seen from the issues.

Potential pitfalls:
Yes, this is depending on fixing the core (keymap) event handling infrastructure of vim. See this attempt to show inbuilds and this closed issue of vim.
The other dependency is the completion of the necessary metadata.

@matu3ba matu3ba added help wanted Extra attention is needed idea labels Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed idea
Projects
None yet
Development

No branches or pull requests

1 participant