Live data from Hacker News

To Master Vim, Use It Like Language

danielmiessler.com

21–30 of 124 posts

Re: To Master Vim, Use It Like Language

#21
post #4

Vim is a regular expression system hooked to a 1970s user interface. If you need to apply regular expressions to text files, vim is useful. I used vi to write code for years, but that was decades ago. There's been some progress since the 1970s.

"a regular expression system hooked to a 1970's user interface" + a whole lot of awesome plugins!

Incidentally, there is nothing inherently wrong with 1970's user interfaces. My car still has a steering wheel just like cars did in the 1970's. And there is a reason for that. Because it works really well.

Re: To Master Vim, Use It Like Language

#22
post #4

Vim is a regular expression system hooked to a 1970s user interface. If you need to apply regular expressions to text files, vim is useful. I used vi to write code for years, but that was decades ago. There's been some progress since the 1970s.

[deleted]

Re: To Master Vim, Use It Like Language

#23
My issue with getting better at vim is that I've gotten to the point where I'm comfortable moving around text, copying/pasting, and everything I would normally do with a mouse. I know vim is so much more than that, but it's one of those things where "you don't know what you don't know" and because of that, I don't have the incentive to continue learning. Hopefully this post will inspire me to incrementally advance my vim usage.

Re: To Master Vim, Use It Like Language

#24
The thing that always frustrated me about Vim (and command-line apps in general) is that it punishes you for being a GUI power user. The more mastery you have of conventional GUI keyboard shortcuts to highlight, jump words, copy/paste, etc., the more often you will reflexively hit them and do the wrong thing while trying to use Vim. You have to unlearn a lot of perfectly good skills before you can really master Vim, and that's frustrating.

Of course it's not Vim's fault that the standards established by vi were not taken up by the early GUI systems, but I wish there was a better way to deal with this problem than a figurative grizzled old console cowboy going "suck it up, n00b, it builds character." I'm aware that people have made command sets that make Vim and the *nix console in general more GUI-standards-friendly, but these are never presented to actual CLI newbies, so by the time you're aware of them you've done half the work already...

Re: To Master Vim, Use It Like Language

#25

Thanks for this tutorial. I'm at Level 1 having switched from an IDE (PyCharm) and I find this helpful. Any reason why you use Pathogen vs Vundle for managing plugins? Does it even matter?

Depends on your needs, Pathogen only manages your plugins, but Vundle, will checkout the plugin, install it, and you can update all your plugins from inside vim.

Edit: spelling

Re: To Master Vim, Use It Like Language

#26
This is a really good introduction to vim. It is better to think of it as a grammar to manipulate text.

A few additional things that have saved me keystrokes...

replace mode (R)

insert normal mode ()

paste from a register in insert mode (reg)

expression register (=)

clipboard and active selection registers (+, * respectively)

command ranges (e.g. 10,+5s/foo/bar/g)

miscellaneous commands (:global, :argdo, :normal, etc...)

Re: To Master Vim, Use It Like Language

#27

Thanks for this tutorial. I'm at Level 1 having switched from an IDE (PyCharm) and I find this helpful. Any reason why you use Pathogen vs Vundle for managing plugins? Does it even matter?

You're doing yourself a disservice. Intellij (PyCharm) has a vi plugin. Whatever extra stuff you give up from regular Vim, you gain an order of magnitude of productivity using a development environment that is "smart". Think about what PyCharm does for you and what Vim doesn't.

Vi(m) is a model, not an implementation. I wish people would stop handicapping themselves with very bad implementations. Intellij, Visual Studio (Resharper) understands the languages your working in. Let the machine do what it does best and aid you in the language while you concentrate on domain.

Re: To Master Vim, Use It Like Language

#28

I consider myself at least an intermediate user of Vim, and I'm glad that you mentioned the "f" motion (along with its cousins "t" and ";"). I don't think these keys get enough exposure among beginner Vim users (they aren't mentioned in vimtutor), but they allow you to quickly and efficiently move across files and do things like "ct(" (change text up to first left parentheses), which is super useful for changing func…

% is really useful for dealing with functions too. For example, deleting "foo(a + bar(x, y) + c)" by placing the cursor on the "f" and executing "d%".

Re: To Master Vim, Use It Like Language

#29
post #5
post #3

> inoremap jk Using two keystrokes instead of ESC to leave insert mode is definitely a personal preference and not necessarily more efficient or comfortable.

Haven't used ESC since finding out Ctrl-C.

bonus is that Ctrl-C gets you out of pretty much any mode.

Also, while in insert mode, using ctrl-h for backspace and ctrl-w for delete word are really nice.

Re: To Master Vim, Use It Like Language

#30

Thanks for this tutorial. I'm at Level 1 having switched from an IDE (PyCharm) and I find this helpful. Any reason why you use Pathogen vs Vundle for managing plugins? Does it even matter?

You're doing yourself a disservice. Intellij (PyCharm) has a vi plugin. Whatever extra stuff you give up from regular Vim, you gain an order of magnitude of productivity using a development environment that is "smart". Think about what PyCharm does for you and what Vim doesn't. Vi(m) is a model, not an implementation. I wish people would stop handicapping themselves with very bad implementations. Intellij, Visual Stu…

> Vi(m) is a model, not an implementation.

I think you are talking about modal editing, vi is an application, vim is another application.

Post reply on HN