5 ms·
y'see, this is the problem with vi users ;) how on earth does 'V4j>' feel better than selecting the lines you want to indent, then pressing tab? This is also
by stevecooperorg 18y ago
y'see, this is the problem with vi users ;)
how on earth does 'V4j>' feel better than selecting the lines you want to indent, then pressing tab?
This is also where macro recorders work a treat; something like
<start macro>
space * 4
home
down
<end macro>
<run macro> * 3
- ichverstehe 18y agoBecause I don't have to remove my hands from the keyboard to fool around with the mouse, and it's extremely powerful and you make clean cuts (eh??). I'm almost never touching the mouse. I do a lot of stuff in the terminal, or using QuickSilver or memorizing all the ridiculous shortcuts different apps have. That way I can work at an incredible pace, and let the mouse sit in the corner.
- stevecooperorg 18y agoI'm almost never touching the mouse. Isn't this true for absolutely every programmer's text editor? Be it vi, emacs, visual studio, eclipse, whatever -- find an editor which can't do everything via the keyboard, and you've probably not got a real programmer's text editor. What's particularly special about vi?
- j2d2 18y agoYou're responding to a vim/emacs comparison so I'll be the first to say you dont need to use the mouse in emacs just as you don't need it in vim. Hit ctrl-space to start a select. Move the cursor until your text is highlighted (you can skip to line if you know the number, also easy in emacs with setnu+), and then hit tab.
- ichverstehe 18y agoI didn't realize. I'm sure I saw a 'select with the mouse' somewhere in there. I didn't.
- j2d2 18y agoYou can select with a mouse too. In my opinion, if you're using Emacs OR Vim you've already won. Apples and oranges, sure, but still fruit where notepad is kinda like a big mac.
- ichverstehe 18y agoAnd, I think what's important is, that 'V4j>' seems a lot more difficult than selecting the lines and pressing tab. But when it becomes habit, you just do it, without putting further thought into it. .. in the beginning it's horrible, though.
- orib 18y agoThe beauty of vim is that the general paradigm is that you apply an action over a structured motion. For example, 'dib' will delete (d) the current inner block (ib), and put it into the paste buffer -- wonderful for pulling a block out into a method. Reformatting a paragraph works similarly -- gqap (gq = reflow, ap = a paragraph). Vim's commands give you a language where you can refer directly to structured entities in your code, rather than being forced to speak in terms of numbers of lines, or cursor positions.
- stevecooperorg 18y agoNow, that sounds pretty nice. This must need language-specific definitions -- a block in python is delimited differently than C, say. What different things can you refer to? I know you can refer to words, lines, characters, buffers, and now blocks. Any other types?
- tokipin 18y agoactually it would be done with '5>>', which is a lot faster, or a command such as '>iB' (indent right inner block) i've written many times why Vim is uber, but the short of it is that Vim is a high level editor