Replies: 7 comments 10 replies
-
I am also of the opinion that helix is way more intuitive than vim but I'm the kind of person who would use vim primarily in insert or visual mode so this is probably a minority opinion. TL;DR |
Beta Was this translation helpful? Give feedback.
-
Hey there. I think on a longer timeframe, I'd love to explore a more thorough rethinking of the modal editing paradigm, and ideally make Zed's binding system and existing "vim mode" powerful enough to express other patterns. While we're the new kids on the block, however, it's super important that we can make users from existing editors feel comfortable when they first try Zed. It's hard work to switch editors. I think once we get more users, it would be really fun to explore new approaches that somebody who is already committed to Zed can explore trying when they're in a position to develop new muscle memory. Love these kinds of discussions. Let's push things forward. Just wanted to explain our thinking in the short term. Thank you! |
Beta Was this translation helpful? Give feedback.
-
I'm late to the party but I wanted to share some thoughts on a concept I call "stackable keymaps" which I'm using for my own editor, kle. This concept was originally taken from mle. The premise is really simple. Keymaps work like a stack. You can push new keymaps onto the stack, and you can pop keymaps from the stack. Keymaps may optionally fallthrough (e.g., a key binding not found in the current keymap will fallthrough the keymap below it). Key bindings may specify what keymap they belong to (if no keymap is specified they belong to the default keymap). This allow you to support all kinds of different use cases. By default, Zed would ship with a default keymap out of the box. Basically what we have now. Vim mode would be implemented by changing the default keymap. The beauty in this architecture is that you get modal editing for free. The default keymap for "Vim mode" would be I proposed the same concept to Craig (the author of dte) here. There I also go over some mle specific concepts in greater detail. |
Beta Was this translation helpful? Give feedback.
-
This sounds quite similar to how keymaps are defined in the open source keyboard firmware ZMK. Keymaps are written in "layers", with the possibility of "transparent" keys, which fall back to the first definition in a lower layer. For example, on an existing keyboard "1" is on layer 0 and "!" is on layer 1, and holding the shift key moves you from layer 0 to layer 1 Regarding modal editing, there is an extension for VSCode simple called "modal edit". Instead of emulating a particular editor, this extension exposes a way to combine any keypress, or sequence, with particular commands allowing you to effectively write your own modal editing experience (iirc it comes with a vim preset). I think this is a superior approach as, in the context of VSCode, it provides a much more native experience as it makes use of existing features, rather that trying to emulate vim features |
Beta Was this translation helpful? Give feedback.
-
I'm quite surprised someone else thought exactly what I was thinking. It will be great to have a modal code editor like Helix to be intergrated into Zed. Since I like their philosophy more(action after selection). I feel like this could help the Helix community to grow as well. Neovim already has a good number of community managed GUI editors. Most notably neovide. I'd like to see Zed editor being the GUI of Helix. I'm speaking for both communities here. |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? |
Beta Was this translation helpful? Give feedback.
-
Big exploratory writeup on the world of Treesitter bindings below. I presume this is a good spot for it? Will gladly move elsewhere if not. The most potent example I've seen of seeing something as intriguing "Post-Vim" modal editing, is Helix adding out of the box support for treesitter selection/navigation, and innate easymotions. That minimal barrier to beating the mouse in editing flexibility and flow is personally my priority over the power of motion editing itself. Which is where the appeal of "Post-Vim" modal editing is for me, reducing mental load to proficiently exploit the power of modal editing to reach that junction point. And I see Zed with Treesitter as real close in potential to lead in the gui editor pack, even without diving into its Vim mode. Zed recently got a taste of more treesitter based editing with syntax node scope selection, which I've enjoyed using, love mrnugget's work on that. Though I do see potential for more power out of this. Some Zed issues on selection of Syntax Nodes I found appealing:
A big rather related one from Helix absent in Zed is It isn't just about selection in Helix, there is also the Vim Unimpaired inspired treesitter bindings under the Though there's a reason I am here rather than in an issue kindly asking for support for Helix's additional treesitter keybinds. And that was, looking at the timeline of these feature additions to Helix, they were all technically, afterthoughts, in what is an editor really about rethinking Kakoune's style to something a bit more vim-like. The new treesitter bindings weren't innate to the design of Helix. They still feel easy to use, but it doesn't feel fully explored, nor prioritized as first class in Helix bindings. While I know I'd enjoy them ported to Zed even as manually binded keybinds largely as-is, I've wondered if there's a more encompassing concept to using treesitter based navigation/selection that could be had. And then I saw the Ki Editor. Ki thinks through using treesitter as the forefront tech to define its new modal editing approach and bindings. Its ultimate demonstration of power to me, is that its file explorer is literally YAML, letting it largely reuse its bindings to get the job done. I was super pumped to toy with it, up till I realized it has no keybind config (the creator announced plans to address this), a no go when I use arrow keys on esdf in a homerow'd layer, rather than hjkl. I also am getting into Zed because it isn't a TUI, as useful as TUIs can be. Other cool advancements Ki makes is first/last sibling, parent line (note the tip of how the yaml file explorer uses it), and how its modal layout gets to be so incredibly tiny in bindings compared to Vim and Helix. One might chalk that up to how young it is, as the author is still expanding its feature set, though I did find their testimony and visual demonstrations rather convincing in its usability today. I think it gets well past that better-than-mouse junction point I look for, with much lower knowledge overhead, provided you know syntax of the language you're coding in. All to say, it gave me much pause on the idea of opening up an issue on adding these treesitter features from Helix. Individually useful treesitter bindings that lifts all vim, helix, and non-modal boats. Or, a modal editing setup that tries to fully capitalize on it? I'm afraid my ability to power use vim and helix isn't quite as advanced as others, so I'd be keen to know what stronger power users would think of Ki in comparison to some treesitter binding additions. Or maybe they too are stuck on a no-go of no keybind configs or GUI as I am to be able to give it its fair shot. I also may be underestimating or overestimating how much Zed can take on at a time in regards to currently niche treesitter-nav/selection features, with no need to deliberate it as a one or the other theoretical. |
Beta Was this translation helpful? Give feedback.
-
Sorry if this is a bit of a rambling type of post but I had some thoughts and wanted to see if I'm alone in this.
So I've been having a play with vim mode in Zed and whilst I know it is under active development and is at least somewhat functional, it did make me think about 'vim mode' in general.
I've used Vim a fair amount in the past and I think what makes it great is really the flexibility and extensibility but honestly, whilst I love the modal editing paradigm, I've never really got to grips with vim shortcuts. They obviously work just fine but many of them are particularly clunky or unintuitive. For this reason I've found myself using Helix (https://helix-editor.com/) an awful lot recently and I just find it so much more natural to use, mostly due to the change in the
selection -> operation
order and more obvious shortcuts (yes I know Kakoune is very similar in this sense but I've never really used it).What I'm trying to get at is that I would love to see a graphical editor such as Zed actually have a fully integrated modal editor that isn't just tacking on some vim shortcuts, rather it would be something that works and makes sense in the context of the entire application. This isn't a dig at the current vim mode in Zed, I realise it is in active development and I've not even used the current implementation that much to really have an opinion on it, this is more of a general thought. Ideally the level of integration would extend to other features inherent to Zed and its UI as well as being available in the rest of the application (e.g. being able to navigate outline mode or the command palette in a modal way as well as having dedicated "vim-like" bindings to enter modes to navigate and use things provided by the LSP or tree-sitter.
Obviously the benefit of the vim way of doing things is that it is far more well known but I'm not sure that should be a reason in itself to stay with it forever, particularly if some kind of compatibility for vim style could be put over the top of it ('it' being this hypothetical modal editor... mode).
Now this might all be nonsense in which case I'm happy for people to inform me why I'm wrong or provide a different point of view but I'd be interested to see if anyone else has any comments on the topic. Basically I love the idea of having the power of modal editing but without having to bring the baggage of the past or trying to make a round peg fit a square hole.
Beta Was this translation helpful? Give feedback.
All reactions