4 ms·
Interestingly, I think you could have the same thing than in vi in Emacs, nothing prevents it. But of course, it isn't the default, nor the way people are used
by norswap 12y ago
Interestingly, I think you could have the same thing than in vi in Emacs, nothing prevents it. But of course, it isn't the default, nor the way people are used to.
The post also fails the mention the concept of region in Emacs: you select a region than perform one (or multiple) commands on it, instead of encoding the region in the command like in vi.
All around, Emacs is harder on the fingers (more keypresses for the same functionality), but that's the price to pay if you don't want a separate edit and command modes; which personally I find very awkward (but perhaps it's a question of habit).
- calibwam 12y agoThe different modes (actually 3 in vi, and 6 in vim) recognise that you need different functionality when doing different things. If you are just writing, you don't need to have edit functionality, if you are reading you need advanced movement, and you don't need all of this other stuff when you are entering a complex command. It is a completely different way of working, but when you realise that you spend most of your time coding not writing, you can see that spending a lot of time in normal mode, with your keys now doing useful stuff, can save a lot of keypresses. Of course, I'm not saying that vi is perfect, and if emacs works for you, then there's really no reason to switch, unless you want to try it out for funs.
- lispm 12y ago> you need different functionality when doing different things. I don't buy that. When I'm using an editor writing, moving and reading is totally mixed.
- calibwam 12y agoOn a macro level, I agree. But switching mode isn't so hard that you have to sit twenty minutes in normal mode, thinking what you would do in the entire document, before you switch to writing it.
- mercer 12y agoEven though I'm a very 'mixed' type of writer/coder, I find normal mode very useful because moving around in the document, for me, is much faster that way. So even if I only have to move x words to the left, delete until the first occurrence of character y, or change the text inside the very next quotation marks (one of my favorite tricks), the 'hassle' of switching between modes is worth the ease of moving around the document. In the few cases where I need to do something even more trivial, I can still navigate the 'regular' way in insert mode. Furthermore, I find that I generally work better if I don't just rapidly and constantly switch (mental) modes, even for prose. I'm starting to feel my 'instant' connection to the output makes me sloppier and makes it harder for me to reason about what I'm exactly trying to do. So for me it even has a psychological benefit to use an editor that has modes.
- vacri 12y agoFor me, the 'hassle' of moving between normal and edit mode in vi is far better than having to use a modifier key for every single command.
- mercer 12y agoExactly. And since I recently mapped 'normal' mode to the Caps Lock key, it's even easier. I did this because I was forced to use a keyboard that had no ESC key, but it's been very useful with vim.
- onedognight 12y agoIt works out in practice that you have vi-like modes in emacs. When you hold control down you are in one mode and when you hold Meta down you are in another mode. The difference is state. In vi you have to remember which mode you are in. In emacs you know by which modifier you are holding down. The issue of compossabity is orthogonal. For example in emacs you can move around, cut, paste, do minor manipulations like swapping words or case all while holding control down. When you want to enter text you let up.
- 12y ago
- stewbrew 12y agoIn vim, you can still move the cursor around when in insert mode. It just isn't that functional and after a while you realize it rather is a beginner's mistake. Anyway, those modes aren't totally separated from each other. There also are shortcuts to quickly do something in another mode. Having used emacs and vim for several years, I now am in favour of vim's editing modes. The only thing I don't like about it is the column numbering at the first or last position of the line (a problem you become only aware of when developing plugins though).
- ibrahima 12y agoSo in some sense there are two major features of vim, one being the composable commands, and the other being the modal editing. They seem to not necessarily be related, for example there's this thing called 'god-mode'[1] for emacs which is kind of like vim's normal mode, and control becomes implicit. I haven't gotten a chance to really adapt to using it but it seems like it could bring a lot of the benefit of vim's shorter syntax to emacs users without requiring us to change our muscle memory with regards to the key sequences. [1] http://chrisdone.com/posts/god-mode http://chrisdone.com/posts/god-mode
- ch_123 12y ago> The post also fails the mention the concept of region in Emacs: you select a region than perform one (or multiple) commands on it, instead of encoding the region in the command like in vi. Would the visual mode selected areas in vim be equivalent to this?
- mkozlows 12y agoThe region thing (along with vim modes) is probably one of the biggest pieces of pushback I've gotten from the piece, and I think it certainly has some merit to it. If you can use movement commands to define a region, and then act on that region, isn't that the same as vim's composability in effect? I think the best answer is "sorta, but not really." The biggest reason why is that Emacs commands don't all work on a region by default. Yes, there's C-w to kill-region, but there's still C-k to kill-line and other special-purpose commands out there. In Vim, there aren't four special-purpose delete commands and then a general-purpose one, they all work the same way. This feels like a qualitative difference to me -- both in theory, and in practice. When I used Emacs for many years, I definitely did use the region commands, but only when the special purpose ones wouldn't work reasonably (like deleting large chunks of code). If I just wanted to delete (for instance) the stuff inside an HTML tag, I wouldn't try to mark off a region and then delete it, I'd just delete by word/character until it was gone. In Vim, I'd "dt>" automatically, because that just makes a lot more sense than repeatedly typing "dw". And ironically, Emacs has a command (M-z is the mapping for kill-to-character) that would do exactly the same as that Vim command. But in fourteen years of Emacsing, I never even looked for it, because Emacs doesn't steer you that way. Vim makes you always think about what object you're applying your command to, and because you always have to make a choice, you look for good choices; Emacs generally defaults you to one of a few often-decent choices, and you don't get into general-purpose mode unless the built-ins are unworkable.