DEV Community

Discussion on: Vim A to Z - Literally

Collapse
 
xexyl profile image
xexzy

Good list; I've used vi since the 1990s and exclusively vim since the early 2000s and there were some I never considered like `dip'. A few comments though.

First of all: look at vimtutor(1) (or just try vimtutor at the command line).

Rather than use what would be in some contexts an anchor to get to beginning of line (i.e. '') you can just use `0' instead. No need to use shift that way.

G: You can also just do G to go to line .

Arrows: Do people actually use those? Interesting... I knew they worked but I've never used them. Started out with h j l k and never looked back. Maybe it wasn't even possible in vi but I've always felt it far more natural to use the same area as if you were typing than to have to move your hand away. As for the h j l k you can also specify a count (never tried with the arrow keys for the above reasons) e.g. 5j goes down five lines.

I: Actually I often enough do insert to the beginning of the line but I tend to use 0i instead. It's just as quick if not faster and it keeps in the theme of go here and do this.

Marks: just like in the pager less (and maybe more - I've not used that in decades now...)

N: But if you're searching backwards (?) it is the reverse: N goes forward, n goes back.

Opening a line without insert: If there is I'm unaware of it but I can say that's not what the O/`o' commands are designed to do - it's as you say to go into insert mode.

:qw: Another way is just ':x'

s: But surely you have however used :s? I rely on it very often. The fact it supports regular expressions (so too does searching for that matter) makes it immensely valuable.

:ZZ: Just like :x (I didn't know :ZZ)

Another you didn't mention (well - not as examples): de or 5de (etc.)

Collapse
 
omerxx profile image
Omer Hamerman

Thank you!
I'm honored to read such a comment from such an experienced use.

Re arrows: you'd be surprised.. people use custom settings to disable their kb arrows just for that.

Re "I" personally I use it when it comes up, and I always prefer least keystrokes, that's me..

Re Marks: I use it quite often, honestly, it's always ma and mb, rarely something else

Re: Correct! Will fix

Re s: nope, but that's why I do these posts, to learn or to be taught by the community ;)

With your permission, I'd like to add your corrections with the appropriate credit

Collapse
 
a5537 profile image
A5537

Maybe it's just a typo, but since : denotes VIM command mode, the "save and quit" shortcut is ZZ in normal mode and not :ZZ. By the way, there's another normal mode combination ZQ which acts like :q! or "force quit without saving".