3 ms·
Understanding what each character means isn't necessarily the goal, however. They're the basic words and commands to manipulate text, but really you should be l
by randomdrake 10y ago
Understanding what each character means isn't necessarily the goal, however. They're the basic words and commands to manipulate text, but really you should be learning how to speak to Vim to get it to do what you want. You need to string together multiple words to make a sentence sometimes. Vim lets you do that. If you're not willing to take the time to do this: you're right, Vim isn't for you. It definitely takes more effort and practice than a lot of other editors.
Intuitiveness becomes more clear once you realize you need to learn the language to make things intuitive.
You can't just start speaking Spanish to someone and expect to get them to do what you're asking if you don't know how to speak Spanish, yet. You can poke and prod at words here and there (memorizing what each character means) but you still aren't very effective at that point. Can you ask where the bathroom is? Sure. But can you effectively tell someone where the correct bathroom is? Probably not.
"I want to yank those two lines, paste them over there, select them, and replace all instances of 'foo' with 'bar'."
Vim:
> 2YjjpVj:s/foo/bar/pg
Like speaking other languages, there are a number of ways you could tell Vim to to do what you want.
Now let's look at other editors when you want to tell it what to do. Other editors:
> Remove right hand from keyboard and put it on mouse
> Move cursor to appropriate position
> Click the button down, and drag it until the two lines are highlighted
> Crtl+C
> Move the mouse cursor
> or move your right hand again to the arrow keys
> Ctrl+V
> Ensure your text is still highlighted in some way
> (May require repeating previous steps)
> Ctrl+F or Ctrl+R or something, depending on the app
> Get into one box and enter "foo"
> Get into another box and enter "bar"
> Ensure you have selected "selected text" so everything doesn't get replaced
> Hit <enter> or click
The infamous Stack Overflow answer, "Your problem with Vim is that you don't grok vi," is an oldy but a goody.
http://stackoverflow.com/a/1220118 http://stackoverflow.com/a/1220118
- aninhumer 10y agoOf course, if you expand every input out to a full line, it's going to look worse than a string of keypresses. However if we compare more fairly: vim: 2YjjpVj:s/foo/bar/pg Sublime: ^L^L^C↓↓^V↓^Ffoo<Esc>^Dbar (This assumes there are only 2 instances of "foo", but you'd just have to press ^D a few more times otherwise.) And sure moving your hand to ↓ takes slightly more time, but it's still no where near as bad as your screed makes out. And if you really care, you can make new shortcuts for movement (by editing a simple JSON file). Personally, my experience is of using vim for several years, and then becoming approximately as proficient in Sublime in a matter of weeks, and then much more productive in a matter of months. And sure, I wasn't putting that much effort into learning vim, but then, I wasn't putting that much effort into learning Sublime either.
- flukus 10y ago>Of course, if you expand every input out to a full line, it's going to look worse than a string of keypresses. However if we compare more fairly: Expanding them into new lines outlines the time spent though. ^L is no where near as fast as 2Y.
- drewgross 10y agoI would say it's faster since with 2Y you have to lift your finger off the 2 before you can press the Y, but with ^L you leave your finger on the ^ while you press the L so it doesn't even really count as 2 full key strokes. (not to mention you have to press ESC half the time in Vim to even get to the mode where "2" is what you want to do)
- flukus 10y agoYou're right, I completely misread the post I replied to. A minor nitpick though, in vim you aren't pressing escape to get to that mode, it's the normal mode, it's where you should always be.
- drewgross 10y agoI usually use Sublime but when I'm ssh'ed to a machine I use vim, so I have some experience. I find that I need to exit insert mode to run commands about half the time, or maybe a little less than half the time, in order to run commands. Maybe thats just due to the type of thing I usually edit though. I don't have enough vim foo to know how to do this, but maybe you do: can you record a session and see how often you pressed escape? I'd be interested to know how often various people press escape.
- aninhumer 10y agoI suspect vim users don't notice because they instinctively press Esc as soon as they're done using insert mode, so they don't think of that as part of the next command. And I think that's fair tbh, it's just something your fingers do while you're thinking about what to do next.
- deleted 10y ago[deleted]