5 ms·
I really don't get how its more efficient than a modern editor! I use vi(m?) when I am working on a unix/linux/mac terminal and have done so for 10+ years. But
by daniel_iversen 15y ago
I really don't get how its more efficient than a modern editor!
I use vi(m?) when I am working on a unix/linux/mac terminal and have done so for 10+ years. But I never bothered learning it properly so I only know a handful or two of commands. So I can't appreciate both perspectives clearly.
However, how can it be faster and more efficient to edit in vi than in a modern editor? I'd assume that if you can use multi gesture scrolling, point and click location, the modern editor type keyboard shortcuts (with multiple keys pressed) that it would lend itself to be faster to work with and more "efficient" somehow (hard to explain).
Would love to know what vi-people think about that because I am most likely wrong (as I said, very one-sided experience) but would love to get that level of detail (I don't think the story was iron clad on that point).
Is there anyone who has switched from many years of very happy vi onto modern editors and love that more?
Thanks..
- jimrhoskins 15y agoI feel like such a tool for saying this, because I thought people who said this were tools before I 'got it'. Taking your fingers off the keyboard and to the mouse and trackpad is slow. I now even get how moving your fingers to the arrow keys is slow. I never thought I would believe it, but somehow here I am, spouting the same nonsense. It's true. I think there is just some mind-body-editor connection that develops with vi(m) usage (and emacs, I don't know). When you really start thinking in vim, your mind starts describing what you need to do in vim commands, that magically flow out of your fingers, and vim responds. In other editors, for any task I need to do, instead of telling my editor to do something, I have to show my editor how to do it by selecting text and menu items with the mouse, it just feels clumsy. Once the keystrokes are muscle memory, it's impossible to beat with point and click in terms of speed. That's just an opinion from a vim novice that can never go back.
- blindhippo 15y agoI've used Vi(m) enough to know that I'm far more efficient in an editor designed to work with my OS. Knowing Vi (or Emacs) is essential as a software developer, but using it as your local code editor has never made sense to me. What most people who pontificated about Vi/Emacs/editor-of-choice often fail to realize is that there isn't a "One True Way To Do Things Bestest". Everyone works differently. Using Vi for 30+ hours isn't going to make me a better developer - and it certainly isn't going to speed up anything.
- deleted 15y ago[deleted]
- DennisP 15y agoTo start with, the way vim keystrokes combine is pretty nifty. To move forward a word, w. To delete the next word, dw. To delete the next 6 words, 6dw. To move to the next "g" character on the line, fg. To delete everything to that character, dfg. To delete everything inside the parens surrounding the cursor, di(. Something I do a lot with viemu in ms sql: Select everything inside parens with vi(, then hit F5 to execute the subquery. But it got really fun when I started using macros. Once you're doing everything with keystrokes and text objects, you can record a macro while you're doing it. So, keeping with sql, let's say I want an update statement. First I use an IDE feature to give me a list of all columns in a table, comma-delimited. qa starts recording a macro into register a Wi<return> advances to the next column name and inserts a carriage return <Esc> q stops recording macro 10@a plays the macro ten times Now I've got each column on a different line. I go back to the first line. qw starts recording a macro into register w ia.<Esc> puts "a." at the beginning of the line yw copies the column name A = b.<Esc> goes to end of line and adds " = b." pA, pastes the column name and adds a comma to the end j^q moves to beginning of next line and stops macro recording 10@w does the same macro ten more times Now with a few keystrokes, I've changed this: column1, column2, column3, ... To this: a.column1 = b.column1, a.column2 = b.column2, a.column3 = b.column3, ... And the key point is, I did it without having to think about it much. I used the same editing techniques I would have used to make that change for just one line, and with half a dozen extra keystrokes I made it apply to as many lines as I needed. Possibly I made small mistakes in the exact keystrokes above. When doing it for real, you see all the changes on that first line as you do them, so if something isn't quite right, just hit u to undo and keep going. It's so easy, I can record and replay new macros all the time. I almost never have to do repetitive editing. Another trick, not available in viemu but available in vim: select a bunch of lines, then type :norm and your next editing commands after that will get applied to all the lines. For example, to add a comma to the end of every selected line, :norm A,