-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Configure continuing line comments #13274
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
Comments
There also an alternative to provide "comment" and "uncomment" as separate commands. The user can then configure a keymap for ensuring a new line without comment. |
this was tried before in #12447 but rejected because you can already do this: [keys.normal]
g.O = ["open_above", "delete_word_backward"]
g.o = ["open_below", "delete_word_backward"]
[keys.insert]
A-ret = ["insert_newline", "delete_word_backward"] it acts basically the same as "insert newline, but don't add comment token" it won't work if the comment token has spaces in it, but it should work for almost all languages |
Would this still work if there was no comment to delete? |
it would not, which is a little unfortunate but you have to pay attention (you can always undo the step with i would personally like to have these static commands:
3 commands that don't need to be bound to anything by default is possibly not too many extra commands?? |
Hmm, that's unfortunate.
The point of making this change would be to make it so that you do not have to pay attention, which is what a good tool should feel like. It shouldn't get in your way.
I agree with this completely. I would support a PR making these changes. |
Issue
I like the change to continuing line comments, as this is useful when writing documentation. However, i often find myself commenting out code and then using the
o
/O
keybinds to create newline after/before the commented code. This is to still be able to reference the older code, and suppress any errors that come from it, whilst rewriting it. And this change drastically disrupts this process, feeling very unintuative to me, as i do not expect comments to be inserted outside of editing documentation.Part of this is when i am writing documentation i very rarely use the
o
/O
keybinds, more often being in insert mode for extended periods of time, where this feature is greatly appreciated and highly beneficial. Whereas when writing code i spend alot more of my time in normal mode.Proposed Changes
I'd propose adding a configuration option that toggles whether comments get continued on new lines when they are created with the
open_below
/open_above
actions. After looking at the configuration options, i am not sure where this would be located.Alternatively, i propose adding two static commands
open_below_no_comment
/open_above_no_comment
.Remarks
I will be happy to develop and implement either or my two proposals (or any other alternative suggestions) to helix. I am just trying to receive feedback before i make the changes, as i am unsure whether this will be accepted or not.
The text was updated successfully, but these errors were encountered: