Live data from Hacker News

To Master Vim, Use It Like Language

danielmiessler.com

11–20 of 124 posts

Re: To Master Vim, Use It Like Language

#11

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…

The commands you mentioned along with "ci'", "ci[", and "ciW" to replace all text between delimiters have been some of my favorite to use. It really annoys me when my terminal's vi-mode doesn't support "ci" (I think it's vim-only).

Re: To Master Vim, Use It Like Language

#12
Great tutorial. About 20 years ago, I was a Level 4 user (by the article's definition), but that knowledge faded with disuse. When I switched back to a Linux/UNIX machine about a decade ago, I started using vim again (well, I started using vi again, but it was vim), and remembered a lot of Level 1 and 2 stuff, and could recall being able to do more, but never had the motivation to crawl through the man page to force myself to recall how I did more.

This article is so logically laid out I think anyone could get to at least Level 3 with the article and a few hours diligent practice. Level 4 would then beckon....

When I became a serious sed - and then ed - user, I became a much better (faster, more productive) vi/vim user when I didn't need to be in visual mode all the time.

Re: To Master Vim, Use It Like Language

#13
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.

I prefer to avoid remappings so that I can use vim at any machine without having to figure things out, so my preference for escape is Ctrl-[. It takes a bit of getting used to but once you get it, left hand never has to reach up anymore.

Re: To Master Vim, Use It Like Language

#14
post #8

Earlier quoted context omitted.

That's just not what vim is... I don't even really know where to begin, you're just flat out wrong. I'd say you're confusing vim with something else, but I don't even know what else fits that description.

1,$s/a/b/

All good editors support regular expressions.

Re: To Master Vim, Use It Like Language

#16
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.

That's just not what vim is... I don't even really know where to begin, you're just flat out wrong. I'd say you're confusing vim with something else, but I don't even know what else fits that description.

He does have a point. Using vi derivatives does seem a tad spartan today, and I've personally never been a fan of vi, nor of emacs, but much of the community has this pseudo-elitist dichotomy set up around those two editor families.

I'm not really a fan of what passes as IDEs, either, but I generally am not attached to any particular editor and hop around them.

(The right answer to vi vs. emacs is, of course, Acme.)

Re: To Master Vim, Use It Like Language

#17
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.

It's definitely more efficient. I've had it mapped that way for years, and after a short time it basically became a single keystroke.

The efficiency doesn't come from the fact that it's not as far to reach. The efficiency comes from the fact that you don't have to find home row with your left hand again and can continue your command sequence immediately.

Re: To Master Vim, Use It Like Language

#19

Earlier quoted context omitted.

That's just not what vim is... I don't even really know where to begin, you're just flat out wrong. I'd say you're confusing vim with something else, but I don't even know what else fits that description.

He does have a point. Using vi derivatives does seem a tad spartan today, and I've personally never been a fan of vi, nor of emacs, but much of the community has this pseudo-elitist dichotomy set up around those two editor families. I'm not really a fan of what passes as IDEs, either, but I generally am not attached to any particular editor and hop around them. (The right answer to vi vs. emacs is, of course, Acme.)

There's nothing spartan about it. Vim has tons of plugins. Using it as a Javascript editor, I've got syntax highlighting, git integration, linting, code completion, and more.

Re: To Master Vim, Use It Like Language

#20
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.

That's just not what vim is... I don't even really know where to begin, you're just flat out wrong. I'd say you're confusing vim with something else, but I don't even know what else fits that description.

GP's comment is actually a very good description of sed.
Post reply on HN