Live data from Hacker News

Intermediate Vim

dn.ht

41–50 of 130 posts

Re: Intermediate Vim

#41

Earlier quoted context omitted.

That's what I was thinking! These are pretty basic.

I think I need the expert guide.

On an Ubuntu box install the nvi-doc package, in /usr/share/doc there'll be two documents vi.beginner and vi.advanced. Open the latter with vim and it'll teach you the more advanced commands.

Re: Intermediate Vim

#42
I’d highly recommend Drew Neil’s Practical Vim[0] for much more like this; it’s broken down into easy chunks and gets into the _why_ as well as the _how_ of Vim’s techniques.

Modern Vim[1], mentioned elsewhere in the comments, covers more advanced Vim usage.

[0]: https://pragprog.com/book/dnvim2/practical-vim-second-editio...

[1]: https://pragprog.com/book/modvim/modern-vim

Re: Intermediate Vim

#43
post #6

Hey all, I'm the author. Feedback is welcome! :) The reason I wrote this is because I've been pair programming quite a bit lately and also mentoring some new vim users—so I wrote this little guide to help vim beginners level up their skills a bit. What I noticed is that a lot of vim beginners find composing commands and text-objects to be kind of mind blowing.. and even more experienced vim users mentioned that these…

Nice checklist... I'm not quite convinced about this as general advice : > If you’re like me and never learned to touch type properly, just use the arrow keys, it’s fine, don’t worry about it. When I decided to go all-in on Vim keys some time ago (trying to find plugins for everything), it didn't take long to transition to hjkl. I think it's easier and more convenient to stay near the home row rather than moving my h…

Was going to comment the same. OP you must be a glutton for punishment if you can't touch type and are using vim

Re: Intermediate Vim

#44

Maybe you can cover macros since they are conceptually very simple and very powerful. They may seem a bit complex but are quite simple. Basically you just record your editing movements and play it back. How macros work: press q x to record and q to end. Then repeat with @ x, where x is the name of the macro you want to use (you can have several macros). Anything you do will be played back. That's it... Conceptually s…

This is really neat, thanks for rundown. Its easy to get far too comfortable with ad-hoc sed commands when there's far better solutions out there.

Re: Intermediate Vim

#45
post #27
post #6

Hey all, I'm the author. Feedback is welcome! :) The reason I wrote this is because I've been pair programming quite a bit lately and also mentoring some new vim users—so I wrote this little guide to help vim beginners level up their skills a bit. What I noticed is that a lot of vim beginners find composing commands and text-objects to be kind of mind blowing.. and even more experienced vim users mentioned that these…

Great article! The features you showed were some of the ones I've had my first "Oh, now I get why vim is so great"-moments and that really boost your productivity. > Tip: Generally after you’ve inserted some text, you want to return to command mode so that you’re ready to enter your next command. I’d recommend pressing esc any time you’ve finished typing. Totally agree with this. What really helped me with getting th…

Some of us even prefer mapping Capslock to both ESC and Control, as explained for example here (I'm not the author): https://www.dannyguo.com/blog/remap-caps-lock-to-escape-and-...

Re: Intermediate Vim

#46

Maybe you can cover macros since they are conceptually very simple and very powerful. They may seem a bit complex but are quite simple. Basically you just record your editing movements and play it back. How macros work: press q x to record and q to end. Then repeat with @ x, where x is the name of the macro you want to use (you can have several macros). Anything you do will be played back. That's it... Conceptually s…

this is somewhat shorter:

    qq0i"A",jq@@
i agree this example is silly. i'd do something like

    :%s/.*/"&",/

Re: Intermediate Vim

#47
post #6

Hey all, I'm the author. Feedback is welcome! :) The reason I wrote this is because I've been pair programming quite a bit lately and also mentoring some new vim users—so I wrote this little guide to help vim beginners level up their skills a bit. What I noticed is that a lot of vim beginners find composing commands and text-objects to be kind of mind blowing.. and even more experienced vim users mentioned that these…

expert vim

    :he

Re: Intermediate Vim

#48
post #24

Maybe you can cover macros since they are conceptually very simple and very powerful. They may seem a bit complex but are quite simple. Basically you just record your editing movements and play it back. How macros work: press q x to record and q to end. Then repeat with @ x, where x is the name of the macro you want to use (you can have several macros). Anything you do will be played back. That's it... Conceptually s…

I was going to say that one annoying thing about these macros is you can't press . to repeat the last macro. It is annoying having to count out 143 lines and then do 143@x or what I tend to do is do it in batches of say 20 until I get to the end.. But this has prompted me to look this up and it turns out that you can use @@ to do this. This will make my life a lot easier, I can just smash until all my lines are updat…

Another notable trick is that vim registers are case-insensitive -- and since macro's are just stored in registers, macro's are case-insenstitive as well. so @q == @Q, which alleviates some of the RSI problems with spamming @q.

Re: Intermediate Vim

#49
post #18
post #3

As a Vim user one of my gripes when first using Vim was how cumbersome the built in help files were. I guess that's why there are so many "vim cheatsheets" out there, the built in documentation is a pain to use.

The biggest pain in vim is the escape key. And no, ctrl+[ isn't any better.

Mapping Capslock simultaneously to both ESC and Control solved this problem for me. It might not be your piece of cake but it definitely improved my vim experience greatly. See for example (I'm not the author) https://www.dannyguo.com/blog/remap-caps-lock-to-escape-and-...

Re: Intermediate Vim

#50
post #27

Earlier quoted context omitted.

Great article! The features you showed were some of the ones I've had my first "Oh, now I get why vim is so great"-moments and that really boost your productivity. > Tip: Generally after you’ve inserted some text, you want to return to command mode so that you’re ready to enter your next command. I’d recommend pressing esc any time you’ve finished typing. Totally agree with this. What really helped me with getting th…

Some of us even prefer mapping Capslock to both ESC and Control, as explained for example here (I'm not the author): https://www.dannyguo.com/blog/remap-caps-lock-to-escape-and-...

I'm the one who map escape to capslock. Since my capslock doesnt usefull at all !.
Post reply on HN