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

Automatically outdent end keyword in languages that use it #13249

Open
rnwst opened this issue Apr 1, 2025 · 1 comment
Open

Automatically outdent end keyword in languages that use it #13249

rnwst opened this issue Apr 1, 2025 · 1 comment
Labels
C-enhancement Category: Improvements

Comments

@rnwst
Copy link

rnwst commented Apr 1, 2025

Neovim automatically outdents lines that contain the end keyword in languages that use it (such as Lua, Julia, FORTRAN, MATLAB, etc.) as can be seen in the Lua snippet below:

Screencast.From.2025-04-01.21-57-18.mp4

Helix, on the other hand, does not do this, thereby requiring the user to remember to press the backspace key (an additional keystroke) before typing end:

Screencast.From.2025-04-01.21-56-28.mp4

It would be great if Helix was able to automatically outdent a line as soon as the user completes typing the end keyword, just like Neovim does.

@rnwst rnwst added the C-enhancement Category: Improvements label Apr 1, 2025
@nik-rev
Copy link
Contributor

nik-rev commented Apr 2, 2025

it would be nice to know how exactly Neovim does this, e.g. I assume they use some kind of tree-sitter query to accomplish this (it needs to be general as Helix can't hard-code anything for specific languages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants