Live data from Hacker News

Ten Years of Vim

matthias-endler.de

61–70 of 123 posts

Re: Ten Years of Vim

#61
post #52

Wait until he discovers emacs! I don't mean that rudely, it's just that emacs can do everything vim does & far more.

There is exactly one feature in emacs vim doesn't have and that's overlays. You certainly know overlays?

Re: Ten Years of Vim

#62

Earlier quoted context omitted.

All the JetBrains IDE's keep a history of your edits, I accidentally rm -rf'd the wrong dir and reverted my code back thanks to JetBrains. I can't imagine vim saving your old files that have yet to be checked in to SVN / git (breaking changes anyone?) that you've not yet opened on vim. Funny you mention that though, a coworker opens files in vim and does changes and tests but keeps it open if he's going to try someth…

FWIW Netbeans also keeps local file history. (Nothing against Jetbrains. They seem like a great company with great products and a really nice pricing model, I just prefer Netbeans.)

After IntelliJ I prefer NetBeans to be fair. I like JetBrains due to all the IDE's they offer me with consistent capabilities between all of them.

Re: Ten Years of Vim

#63
post #37

I use (Vim IMproved - not vi) vim all the time. I find it interesting to see what features other people tend to use in vim, there seems to be some minor differences in their workflows, but it's not clear who "wins" the productivity battle. I only use a very small number of it's features: * `:tabe` Create a new tab * `:e .` Start browsing files in that tab * `:w` Write the file * `:q` Quit the file (`:q!`, seriously,…

That's a solid set and will take you far. I did eventually start peppering in a few pattern matching command things that don't require much regex. * `:g` Global command, executes an Ex command on every line that matches via the pattern `:[range]g/pattern/cmd` One common use I have for using `:g` is to delete all lines that match or do not match a pattern, like when I've removed an attribute from some data structure a…

Thanks for this. Been using vim for 3-4 years and I've never seen the norm command.

This is next months habbit I guess!

Re: Ten Years of Vim

#64

One current problem I have with Vim is those linux distributions where someone - maybe the VPS vendor/hosting company - put in some mystery .vimrc file somewhere that makes the editor apparently more friendly for new users. So you copy and paste a line to your mysql config file, to restart the database service and find that nothing has changed. So then you edit the file again and discover that the mystery .vimrc file…

This can almost certainly be avoided by typing “:set paste” before entering insert mode and pasting. Give it a try!

Re: Ten Years of Vim

#65

One thing google can do that blows most peoples mind when I show them: Did you know vim supports time travel undo? Sometimes you do some things then undo and redo trying to get back to a certain point in time. In vim you can step forward and back through all this by doing "g-" or "g+" to travel backwards or forwards in time. Or you can say ":earlier 50s" to go back to where you were 50 seconds ago. Most editors treat…

I often find my self editing line x, and then add a few lines, only to find that the edit I did on line x is now needless and I want to revert only that line.

In photoshop you have an undo paintbrush. I'd love to have something similar in my text editor.

Re: Ten Years of Vim

#66
post #51

Earlier quoted context omitted.

>Vim IMproved Oh, so you are using an improved version of Vi IMproved? ;)

Emacs + evil-mode, presumably. :)

I need to use Emacs rather than vim for some things (Proof General, mostly), and I was surprised how well evil-mode works. It's only undo that I don't get. From vim I'm used to be able to undo as many editing steps as I want. In evil-mode, I find that if I type "u" too many times, it runs out of undos to do and starts undoing the undos (i.e., it starts redoing things I want to go away).

Also, search uses different word separators from vim: In vim "foo_bar" is a single word that will be skipped by pressing "w". But in evil-mode the "_" is a word separator, so the above is three words. That breaks my flow every time.

Some of this might not be due to vanilla evil but due to the fact that I'm using it through Spacemacs.

This is my two cents. If by any chance anyone would know off the top of their head how to fix these, I'd be greatful.

Re: Ten Years of Vim

#67
post #37

I use (Vim IMproved - not vi) vim all the time. I find it interesting to see what features other people tend to use in vim, there seems to be some minor differences in their workflows, but it's not clear who "wins" the productivity battle. I only use a very small number of it's features: * `:tabe` Create a new tab * `:e .` Start browsing files in that tab * `:w` Write the file * `:q` Quit the file (`:q!`, seriously,…

Most of those are plain vi ( and ed ) commands.

All of my machines have the vim-tiny package to stay as close to stock vi as possible. I open and close the editor dozens of times a day to make simple changes and I don't tolerate any lag.

I can see that vim would be great for long-form programming but plain old vi was just fine for most admin tasks.

Re: Ten Years of Vim

#68
post #3

It's highly overstated how hard it is to learn imo. I would learn it again without a doubt.

I ran 'vimtutor' twice and felt comfortable enough to switch. I think the only reason people think it's so difficult is they maybe try to go too deep too fast?

Most of the people I've talked to who gave up on trying to learn vim didn't even know vimtutor existed.

Re: Ten Years of Vim

#69
post #37

I use (Vim IMproved - not vi) vim all the time. I find it interesting to see what features other people tend to use in vim, there seems to be some minor differences in their workflows, but it's not clear who "wins" the productivity battle. I only use a very small number of it's features: * `:tabe` Create a new tab * `:e .` Start browsing files in that tab * `:w` Write the file * `:q` Quit the file (`:q!`, seriously,…

I'm guessing you mean "dd" and "yy" to delete/yank lines. "x" deletes a single character, what you mean extract a line? If you learn "w", which just means advance by a word, you can combine them with your existing knowledge for much better use. So "dw" becomes delete a word, or "d3w" means delete next 3 words. "v" is also useful in conjunction with "w" / "b".

I would either:

* SHIFT+V to highlight a line, `d` to delete * `:d` to delete the current line

Not experimented with `dd` (or `yy`).

Re: Ten Years of Vim

#70
post #37

I use (Vim IMproved - not vi) vim all the time. I find it interesting to see what features other people tend to use in vim, there seems to be some minor differences in their workflows, but it's not clear who "wins" the productivity battle. I only use a very small number of it's features: * `:tabe` Create a new tab * `:e .` Start browsing files in that tab * `:w` Write the file * `:q` Quit the file (`:q!`, seriously,…

>Vim IMproved Oh, so you are using an improved version of Vi IMproved? ;)

Aha yeah, it's a recursive improvement on itself, like the GNU acronym!
Post reply on HN