News for hackers. Stuff that matters.
Re:Best of Vim Tips by scrollaway on Wednesday June 25, 2014 @09:53AM (#7943829)
I completely agree that this is a garbage "tips" webpage... it's not tips, it's a bloody reference manual.

HOWEVER: The article you linked is similarly bad. There are excellent reasons to use vim outside of "keep your fingers on the home row". Very common operations such as "delete the next 30 lines", "Move these 10 lines to just after line 150" and so on are much faster in vim and this is why I use it. I don't use it for hjkl (which is only there because of the presence of arrow keys on those specific keys in the 80s) and I certainly don't use it so I can write plugins in the god-awful vimscript. Although it's nice these things are there, that is really not why I use vim.

No, I use vim because it has a comfortable set of basic keybindings, which you will use a lot while you get used to the more complex ones.

Besides, it's not so much about using vim, but about using a good GUI editor with vim mapping.

Re:Best of Vim Tips by edwintorok on Wednesday June 25, 2014 @09:57AM (#7943863)
Re:Best of Vim Tips by jodrellblank on Wednesday June 25, 2014 @01:43PM (#7945562)
On paper this works perfectly, in reality it doesn't.

A lot like Regexes. The first n attempts at a regex always fail, and fail for human reasons - I didn't spot that the pattern I'm matching on actually appears earlier in the writing, the pattern has a typo but I spelled it correctly, the pattern used a unicode character that looked like an apostrophe, etc.

And Vim composability suffers in exactly the same way. "Delete back eight words" works on paper, but eight words isn't a thing you can glance at, it means stopping and counting - especially not if it goes back over a linewrap. And does what about the word boundaries? If the cursor is in the word, at the end, at the start but still has to cross the word boundary to get to the previous word?

Combined with that, the way Vim commands have instant and unbounded effects means that the wrong command or a misspress of a key, and suddenly there's a huge change to the text and you don't know what happened. This leads to the effect where even if a change looks right, if it was a big change ("add a comma to every line just before the last word") needs a lot of careful verification to make sure it worked as intended.

In real world use, almost everything I try to do in Vim outside the everyday patterns of habit, takes enormously longer, works less well, is more fiddly and stressful, than 'just' doing it by hand or in Python.

Re:Best of Vim Tips by edwintorok on Wednesday June 25, 2014 @02:42PM (#7945937)
You can get sort of a preview by going into visual mode with 'v' and then typing in the motion command, and once you are happy with what was selected you delete the visually selected text. I agree that its not very consistent here, because for a regex replace you would use a /c instead to get confirmation.

Regarding the 'I pressed the wrong key' problem there is undo (and if you enable undofile you can undo even after saving or reopening the file), and there is git history.

Having said that I agree that there are often situations where automating something (or using a more complex Vim command) would take more time than doing it by hand.

Re:Best of Vim Tips by bch on Thursday June 26, 2014 @03:18AM (#7948482)
If it's important, I'm nearly always using version control which helps with direct or indirect fixing of misapplied actions.
Re:Best of Vim Tips by geertj on Wednesday June 25, 2014 @11:27AM (#7944538)
In addition to composability, which I agree is a big idea, I believe there's another big idea in Vim: modal editing.
Re:Best of Vim Tips by scrollaway on Wednesday June 25, 2014 @10:34AM (#7944110)
Yes, I know the article and wholeheartedly agree with it.