*Not* continue comment on enter #12815
Answered
by
nik-rev
lambda-dom
asked this question in
Q&A
|
In the newest Helix version, if I am in insert mode in a comment line and hit enter, it continues the comment, e.g. using Haskell line comments for illustration (^ denotes cursor position): -- a comment.^Hitting enter, produces -- a comment.
-- ^But I want: -- a comment.
^Backing out to normal mode and hitting o also produces the same effect; in other words, the only way now is to "undo" the comment. Is there a keybinding available which I managed to not find? Or can one be made? |
Answered by
nik-rev
Feb 8, 2025
Replies: 2 comments 4 replies
|
You can turn the feature off: https://docs.helix-editor.com/master/editor.html#editor-section # ~/.config/helix/config.toml
[editor]
continue-comments = false |
1 reply
|
You can also create keybindings to create a newline without adding a comment token: [keys.normal.g]
O = ["open_above", "delete_word_backward"]
o = ["open_below", "delete_word_backward"]
[keys.insert]
A-ret = ["insert_newline", "delete_word_backward"]This is what I use and it's quite effective |
3 replies
Answer selected by
lambda-dom
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also create keybindings to create a newline without adding a comment token:
This is what I use and it's quite effective