Earlier quoted context omitted.
I use the . (dot) command a lot out of habit. It executes the last command. If the last command was a macro execution, dot doesn't execute the macro - it executes the last command of the macro. Is there a way to fix this? edit I see someone else answered this - use @@ instead of .
@@ repeats the last macro
Intermediate Vim
61–70 of 130 posts
Re: Intermediate Vim
#62Hey 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…
Re: Intermediate Vim
#63Hey 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…
Re: Intermediate Vim
#64If this is intermediate, then I must be an expert.
Re: Intermediate Vim
#65One thing I'd suggest for the author, based on a quote from the article - "Invest your time to learn new skills" - Try and invest some time to learn touch typing.
I worked as a developer for years thinking that it wasn't worth the effort, but after taking a couple of weeks to learn, I never looked back. My productivity, particularly with Vim has jumped leaps and bounds.
Re: Intermediate Vim
#66Earlier quoted context omitted.
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
#67Earlier quoted context omitted.
My collegues are constantly complaining their (mac) laptop keyboards are terrible, however aren't ballsy enough to say "F-U" to the corporate choice of a mac or a windows laptop.
Well, HNers complains the MacBook keyboard as it’s a complete trash, but please remember that there are plenty of people that likes and even loves the butterfly keyboard. The keyboard itself is pretty awesome and provides much stabler keys than usual keyboards (whether it’s membrane or mechanical). They work regardless of what part of key I press, which means that typo rates significantly decreases. I’m happily using…
I'm happy with the generic HP keyboard I'm using at the moment, circa 2014, and my T410s old style thinkpad keyboard.
Re: Intermediate Vim
#68Re: Intermediate Vim
#69Maybe 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/.*/"&",/
Macros really shine when you need to do a bit more complex stuff, there is certainly a cutoff between ease of regex "from the top of my head" vs. spending time formulating it.
Re: Intermediate Vim
#70Maybe 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…