Alias Ctrl-c as ESC? #5747
Replies: 4 comments 1 reply
-
Totally agree with it, I am used to treat the ctrl + c as esc in vim, it is convenient especially when you remap the capslock to ctrl and you can do it in on hand(compared with ctrl + [). In most of cases, in helix, as well as the other cli tools, the ctrl + c is treated similar to quit. however, only in comment, it is treated as comment. this inconsistent behavior makes people confused. maybe set the comment to ctrl + / is a better solution? especially a lot of modern editors are using ctrl + / as comment. Plus, the comment behavior is much less used than quit, especially in a modal editor. |
Beta Was this translation helpful? Give feedback.
-
I'm in a very similar boat. I'm totally reliant on Ctrl-C in Vim, and I've set up several Helix keymappings that make it my "get rid of everything" button:
I was very pleased with this, until I noticed that Ctrl-c interacts poorly with autocomplete popups. Sometimes it closes the popup without leaving insert mode, and other times it does that and also deletes the last few characters I typed. I seem to be in the same situation as this commenter. P.S. I'm using @semin-park's jump mode branch and it's fabulous. I couldn't live without it. |
Beta Was this translation helpful? Give feedback.
-
this is the part that really annoys me. @the-mikedavis any chance of this getting looked at in the future? i see that even @archseer effectively does this via a hardware remapping but those of us that want to keep using caps as ctrl on tap are stuck. |
Beta Was this translation helpful? Give feedback.
-
Here is an tutorial how you can remap caps lock in a way , if you tap it, it's escape and if you hold it , it's ctrl. It works on os level, and also I am using this for over 3 months without any problem. https://forum.endeavouros.com/t/tutorial-expanding-the-modifier-keys/6956 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(Tried a brief search on existing issues, but couldn't find a discussion on this. Please let me know if this is a duplicate.)
I'm curious whether it would make any sense to treat Ctrl-c as ESC in helix in general.
In vi/vim, although there are some subtle differences between ESC and Ctrl-c, they're mostly similar in the sense that they both can exit out of the current "flow". For example, both ESC and Ctrl-c can be used to exit out of different modes, exit any prompt, cancel any search / command that's currently being written.
We have this behavior in helix partially as well, such as in closing pickers or closing prompts, where Ctrl-c and ESC can both be used to close the construct at hand.
On the other hand, in normal mode, it's used to comment or uncomment the selected line(s).
Although it makes sense to overload a character sequence to different things for different modes, I'm curious if it would make sense to make Ctrl-c equivalent to ESC for the following reasons:
Since there is partial support of using Ctrl-c to break out of the current "flow", users coming from vim might expect Ctrl-c to behave similar to ESC in other modes as well. This was the case for me, and from this comment, I got the impression that I might not be the only one.
Since there is partial support of using Ctrl-c to break out of the current "flow", it becomes ambiguous what needs to be done in some cases. Going back to the comment from the first point, jump mode (Enhanced jump mode (based on #3791) #5340) can either ignore Ctrl-c and treat it like a normal
c
, or it can treat it specially, and let it break out. The former is what insert mode does, and the latter is what prompts and pickers do. So it's left up to the feature/plugin developers to decide how Ctrl-c is treated. I hope helix could make it consistent, so either it breaks away from the vim-style Ctrl-c entirely and declare that Ctrl-c doesn't have a meaning in helix, or it sticks to the vim-style Ctrl-c and alias it to ESC (I personally hope for the latter)Terminal based text editors usually have an emphasis on keeping your hands on the home row. But you need to escape from the home row if you want to press ESC, and it would be great if there could be a character sequence that I could use as ESC, that doesn't escape the home row. For insert mode, I can remap
C-c = "normal_mode"
, but I'm talking about escaping in general. It doesn't have to be Ctrl-c, but if helix is going to pick one, I don't have a strong opinion why helix should run away from Ctrl-c.Beta Was this translation helpful? Give feedback.
All reactions