Live data from Hacker News

Ten Years of Vim

matthias-endler.de

51–60 of 123 posts

Re: Ten Years of Vim

#51
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? ;)

Emacs + evil-mode, presumably. :)

Re: Ten Years of Vim

#53

Surprised to see that he's gone back to an empty vimrc after years with high customization. To me customization is such a great part of vim that I can't imagine being without it. For instance, I have shortcuts to find and replace on visual selection. I also have at least 5 plugins in my vimrc that are absolutely necessary for my workflow. Pure vim is nice if you need to occasionally edit files, but if you use it as y…

My experience has also been with a decaying amount of customization. As I get better with Vim I learn more and more how to do things in a "Vim-native" manner which I had previously needed plugins for. For example, when I first started using Vim, I relied heavily on NERDTree. These days, netrw works perfectly fine for me.

This is what I tend to hear from Emacs people too. Not an absence of cpnfiguration, just a surprisingly minimal amount because to them, the defaults start making sense. I have no idea if this is because the human learns the editor, or if it is the editor shaping the thoughts of the human, but it sounds nice and I sort of wish I would get there soon.

Re: Ten Years of Vim

#55

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…

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.)

Re: Ten Years of Vim

#56

Earlier quoted context omitted.

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".

'[d|c]iw', to delete/change the word your inside of is another small improvement.

I'm also a big fan of `ci[(|'|"]` to change all the text between a pair of delimiters. I can type `ci"` while my cursor's at the start of the line, and it'll jump to the first set of double quotes, remove the text that's currently between them, and enter edit mode.

Re: Ten Years of Vim

#57
post #45

I read an article a few years ago, the name of which escapes me. It was something like “Idiomatic Vim” or “Linguistic Vim”. I would love to find that article again, if anyone happens to know based on the sparse info I’ve just provided, I would greatly appreciate it. One of the things I learned was that you can do things like yank to a character. In other words, if your cursor is at the beginning of “The quick brown f…

To sure about your article but this sort of thing is the subject https://pragprog.com/book/dnvim/practical-vim

It’s full of tips on doing things “the Vim” way without plugins.

Re: Ten Years of Vim

#58
post #8

Earlier quoted context omitted.

Isn't `gt` and `gT` faster? You don't have to move your hands!

I like `gt` and `gT`, because they are available out of the box on remote servers too.

Also you can use gt to jumpe to, say, second tab.

Re: Ten Years of Vim

#59
Nowadays, I prefer Kakoune ( http://kakoune.org/ ) to vim. Being based on selections rather than movements feels much nicer. It feels a bit like always being in a kind of visual mode. That said, there are the following caveats:

* Vim tends to be installed/available almost everywhere, Kakoune isn't

* Vim has a much bigger ecosystem

* There are some very advanced features hidden in vim that most people don't know about. If you depend on those, substituting vim with another editor can be hard.

Re: Ten Years of Vim

#60
post #38

OP should consider using buffers: you can :ls to display the list of buffers (which I have mapped to gl ) and then :bn (where n is a buffer number) to go to some specific buffer. Also, in the same fashion of gt and gT for tabs, I mapped gb to go to the next buffer, gB to the previous one, and g space to go to the last one. IIRC all these key bindings are unused by default. In my opinion tabs are more useful/interesti…

I use CTRL-j and CTRL-k to cycle through my tabs. It's like j/k except for tabs instead of lines:

    map  :tabn
    map  :tabp
I also alias ":split" to ":tabe", because my fingers will be forever wired to type ":split " when I want to open a new file.

    cnoreabbrev split tabe
Post reply on HN