52 ms·
> "If you have to move more than a couple of lines, moving one line at a time by holding down j or k is inefficient." This very point is actually why I moved f
by sdegutis 10y ago
> "If you have to move more than a couple of lines, moving one line at a time by holding down j or k is inefficient."
This very point is actually why I moved from Vim to Emacs years ago. After mastering Vim, I realized that Vim strongly encourages you to think a little too much about exactly how to get there or do that thing in the fewest keystrokes, and that it's incompatible with muscle memory. Even years later, I still had to think too much about it. Whereas in Emacs I can just use basic character/word/line-based movements and let my muscle memory do its thing while I let my brain focus on the code itself instead of how to use the text editor.
- xemdetia 10y agoAs an Emacs user I want to plug ace-jump-mode to move around the viewable part of the buffer more efficiently than many of the commands mentioned in the OP's post. 1. look at character you want to go to 2. M-x ace-jump-mode (I have this bound to F9) 3. Hit key for the character you want to go to 4. All instances of them are rewritten in the buffer with a coloured character. 5. Hit the coloured character you are looking at. The trick is to just look at where you want to go and touch type the rest. Even on very large monitors with dense data (I find this invaluable if I am going through an minimized HTML blob or a plaintext database dump) this can turn any point to be 3 keystrokes away. Cursor + search forward doesn't work if there is a lot of duplicate text around where you want to go, like a string of five .set* methods and you are trying to kill the third one
- qwertyuiop924 10y agoI have got to try AceJump one of these days...
- mrkgnao 10y agoThis reminds me of easymotion.
- to3m 10y agoJust a question of practice, I found. I was a regular vim user in the past, and this was my criticism of in when first starting out - but after a while I found myself unthinkingly coming up with surprisingly complicated sequences of keypresses. It's possible to get very good at subconsciously sizing up editing operations. These days I use emacs, and I pretty much always move the cursor using the mouse.
- sevensor 10y agoWhile I use j and k a lot for local moves, for bigger jumps I almost always use other means: jumping to a mark, searching for a string, :123 to jump to a line, gg and G to go to the start and end. Or, less often, I fold and navigate around the folds, although I'm not a big fold user. I very rarely hit hjkl more than ten times in a row.
- sdegutis 10y agoWell I got really good at it after like 5 years of using it, and that muscle memory never kicked in for me. So maybe it's possible that it can be done, just not by everyone?
- plgs 10y agoHonest question: How does Emacs help with this particular problem ? I feel like with every editor, it involves repeatedly hitting J, Ctrl+N or down arrow, which is inefficient. Do you have a way to get to a particular line that does not force you to think too much about how to get there ?
- sdegutis 10y ago> How does Emacs help with this particular problem? What, inefficiency? Inefficiency wasn't the problem. The problem was having to focus too much of my mind on how to use the editor. Muscle memory is invaluable, and Vim just doesn't let my muscle memory take over if I keep having to think about what's the most "efficient" way to move around or change text. Emacs lets my muscle memory take over easily. I just hit C-n or M-S-] a lot. It's inefficient, sure. But who cares? I never realize I'm doing it, and I never feel blocked having to wait until I get to the line I want to.
- aidenn0 10y agoNormal vim users aren't thinking about the most efficient way to perform an edit, but rather just go with muscle memory. Said vim users also don't write blog articles on how to be more efficient with vim.
- sdegutis 10y agoWell after 5 years of using Vim, the muscle memory for more efficient operations never kicked in. I was either holding "h" and "l" to move around, or I was consciously thinking of the more efficient combined operations like "f.ce.com^[". And that conscious thinking was very distracting from the actual code I was editing.
- disease 10y agoI used vim for everyday use for almost ten years before I realized that navigating around with the keyboard would never be as good as clicking a mouse. All the mental overhead of trying to be efficient with vim, for me at least, ended up being a bit of a false oasis. I happily switched to Sublime for two years and then VS Code. I still use emacs with Clojure though.
- tmsbrg 10y agoPersonally I think some people just go too far with that kind of /efficient movement/ thinking. There's nothing wrong with pressing j or k a few times, and I agree it's a waste of brain energy to think hard about how to get wherever. (I also think hjkl vs arrow keys is overrated, though I've learned to use hjkl) The only commands I use to move vertically in vim are j, k, /, ?, ctrl-d, ctrl-u. And sometimes I just get the mouse and click.