-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make initial editing mode configurable #3366
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is simple enough and looks good to me
I just want another maintainer input about the new option before merging
Seems to me this would also set any opened documents to change the mode? Apologies if I did not read it correctly on my phone. I'll test it later today :) EDIT: Yeah, it reverts to insert mode for all subsequent opens
That statement is not currently correct, but I would love it to be! |
I can't reproduce that (or perhaps I'm misunderstanding you?). My steps are:
|
Try navigating to a new file. Use What I'm trying to say is that this feature is more like Keep in mind that I'm only a user and have no authority on this. 😊 Maybe @CBenoit should chime in? May I request this setting changes name to something like |
I think I understand now. You would like only the first document opened in a Helix session to be opened in the specified mode. That's not what I want, so as far as I'm concerned, this PR is working as intended. I'm also still happy with the name If you are indeed making a PR for the alternate configuration you have proposed, may I suggest the configuration name |
I really don't understand the use case for opening every document in INS mode. I've spoken my mind (a few times already, sorry) and will wait with
(it may be my vocabulary is a bit tied in with the code base, where the |
Long term, I want to make it possible to configure Helix as a modeless editor (just like some modeless editors can be configured for modal editing). Starting in insert mode (and never leaving it afterwards) is one of many puzzle pieces required for that to work. As for the config name, I'm definitely still open to suggestions. "Initial" here refers to the initial state of each document, which IMO is logical since editing modes are defined on a per-document basis. I've also considered |
This is a bad idea in my opinion. Helix is not a modeless editor. If you want one, there are plenty of other options out there. We should not be encouraging more users to try to use helix as not-modal. |
IMO this is too niche to warrant its own config option, especially since Helix is inherently modal as dead10ck says. I think this would be more elegant when scripting support comes - probably with some sort of hook mechanism that enters insert mode when on buffer creation. Until scripting support comes, this is a one-liner to maintain in a fork and merge conflicts should be trivial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be more elegant when scripting support comes - probably with some sort of hook mechanism that enters insert mode when on buffer creation.
Fair point
Since Helix suffers from the same fundamental bug as Vim and Kakoune, its default keymap is essentially unusable with many non-English keyboard layouts. So the user has the option to invent their own layout-independent modal bindings, or try to configure standard modeless bindings. If you don't want to come up with your own bindings, and modeless configuration isn't supported, Helix effectively becomes a (keyboard) hardware-dependent editor, which would be an extremely sad limitation considering Helix's many other strengths. |
I feel like I am saying this way more often than it should be said, but if you try to shoehorn a modal editor into a non-modal editor, you're gonna have a bad time. A non-exhaustive list of issues people have had that are a direct result of trying to make helix work in insert mode 100% of the time:
I won't repeat myself about the reasoning again, feel free to read the issues. Helix is a modal editor, and we should not be encouraging its use as a non-modal editor. The history of the world's software being heavily biased toward English and QWERTY is indeed unfortunate, but is a much much larger issue than this text editor, and we are not on a mission to solve the world's incompatibilities between locale, hardware, and software, and at this point in time in the project's life, we do not have the resources to provide a nice out of the box experience for every language and every physical keyboard layout. As frustrating as it may be to have to make your own key bindings, this is simply a resource issue. |
Almost all source code in existence consists exclusively of ASCII symbols, yet Helix goes to enormous lengths to support Unicode, sacrificing simplicity and performance in the process. But the huge number of people who don't/can't use en-US keyboards get told to either figure out their own config or pound sand? That makes no sense whatsoever. |
Sure it does. Most of the heavy lifting with Unicode is done for us already in the form of well tested libraries that we don't have to maintain. Editing and displaying text in a single well defined international standard format is a much different beast than coming up with a key binding layout that works for the literal hundreds of physical keyboard layouts in existence. I'm not sure you're taking the time to appreciate the scope of that task before making demands of a loosely organized group of volunteers who work on this piece of software in their free time for no compensation. Kindly take your snark elsewhere. This is also getting very off topic for this PR. |
Umm what? I created this PR. It's me who's working towards implementing a solution here. I make no demands from anybody. You commented here dropping a bunch of vaguely related issues that supposedly demonstrate why making the initial mode a config option is wrong, while offering nothing regarding the actual problem, besides "bad luck, that's how it is". But whatever. If the attitude demonstrated in your comments is in any way representative of the Helix community as a whole, that's all I need to know. |
Apologies, I've only seen this thread now. @p-e-w I'd like to apologize because this is certainly not the tone I'd like to set for the community. While I don't merge every PR, I think it's at least worth discussing proposals.
I don't like the tone here. @p-e-w was just genuinely trying to fill a need they had, and none of the comments were snarky. We should strive to have a civilized discussion here rather than scaring away developers that are willingly trying to contribute. While this specific PR is a one-line change, I, for one appreciated @p-e-w's input in #1623 (comment) for example, given the past experience with the Micro editor.
I also didn't see this implied anywhere. Your reply was far sharper. Now, regarding the PR itself: There is some precedent in
I don't hold this as a design goal myself and wouldn't ship modeless mappings out of the box, but we should at least strive to make commands flexible enough to make this work with a custom config. We are already mostly there because commands aren't mode dependent, select mode is just simply a second set of mappings overlayed. It gets a bit trickier with undo state handling though. |
Thanks for the feedback, @archseer. FWIW, the roadmap I had in mind towards configuring Helix as a modeless editor is something like:
I don't think there is much more to it than those items. While 3 and 4 are by no means trivial, they don't seem like insurmountable obstacles either. A "modeless" editor is just a modal editor with a single mode. The reason why Helix can not yet be used modelessly isn't that Helix is a modal editor, but that Helix hardcodes certain behaviors into specific modes, rather than making them options for configuration. With enough options, it might even be possible to remove all mentions of "insert mode", "normal mode" etc. from the code itself and make modes (including the number of modes!) configuration-only, which would enable radical experimentation with new editing models that are modal, but not based on Vim. It's also worth noting that there are currently zero modeless TUI editors that support LSP, DAP, Tree-Sitter, and many of the other great features Helix has. Making it possible to use Helix modelessly could therefore unlock a substantial market of users who work in the terminal and are currently stuck with Nano or Micro, neither of which provide advanced language features. |
This is something I was thinking about too! |
I would greatly appreciate this PR. Helix isn't just a good modal editor, it's also just a good editor regardless - and as @p-e-w went over, the additional changes needed to make Helix work in a non-modal fashion are rather small. |
@p-e-w Do you have a fork where you’ve implemented this and/or are working towards this goal? I’d love to see it and possibly be involved. As you mentioned, there is a huge gap right now for a “modeless TUI editor that supports LSP, DAP, Tree-Sitter, and many of the other great features Helix has” and given that Helix is currently introducing barriers of entry instead of removing them, I believe there’s room here either for a Helix installer that seamlessly configures Helix with friendly defaults (what I’ll likely end up creating) or (very much a last option) a fork. (Ideally, of course, I’d love it if Helix was configurable enough that you could achieve this without a fork as – speaking from prior experience – it’s no fun to maintain a fork.) |
As someone brand new to this community, I am quite surprised by Helix being less hostile to newbies than Vim and Emacs traditionally happen to be, in my experience. Helix is the first modal editor, that makes sense for me. Out of the box, and even after configuring it a bit for myself. I must say, in parts, that had been easier than with VSCode. That is also, why I think its very sad, and potentially extremely damaging to the project, if hostile behavior is encouraged by simply watching it happening. Just saying Now about the issue: I like to fire up my editor, and start writing. Has nothing to do with using the editor in a non-modal fashion. I like the modes, they make sense here. I just like to sit down, and start typing. The mode in which the editor starts for me, is preferably insert. Can we make this happen? |
@p-e-w Could you open this once again, please 😃 |
ref: helix-editor/helix#3366 Co-authored-by: Philipp Emanuel Weidmann <[email protected]>
ref: helix-editor/helix#3366 Co-authored-by: JJ <[email protected]>
ref: helix-editor/helix#3366 Co-authored-by: JJ <[email protected]>
This simple change makes it possible to set the default editing mode for newly opened editors to something other than normal mode. For example, to start in insert mode, just add
to the config.
I've always wished that Vim provided this option, since I find starting in insert mode more useful when I launch the editor to quickly write something down.