• Vehicles • Fashion • Recipes • Blogs • Hunt • Travels • Sport • Fun • Handmade • IT • Education
Mini-Games
x

x
zakruti.com » IT - Software » IT, programs, coding
Vim Macros Make The Impossible Possible DistroTube

Vim Macros Make The Impossible Possible DistroTube

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Vim Macros Make The Impossible Possible DistroTube A short video demonstrating the power of Vim macros. - https://vim.fandom.com/wiki/Macros zer0python: You should've also mentioned that if you mess up in a macro, you may need to start over. :) (vim doesn't like u's in its macros it seems, or at least in my experience it doesn't.) It's a super PITA if you're just about done with a complex macro and you mess up. It's like -craaap!!!-
Date: 2022-03-30

Comments and reviews: 8


Hey distrotube, great video!
Just to point it out, I think the first macro didn't work as expected: In case you have two consecutive United States entries in your mirror list, the second one will be removed (you can in fact see it with the example you showed on video)
Regards

reply

Hi. Big fan of Vim here. But... Isn't this (the first one) the kind of task sed was created for?
I think $ sed -ni '/United/,+1p' does the job (please correct me if i am wrong).
But anyway, great video (as usual).

reply

I try to avoid macros as a general policy, you can pretty much do anything a macro can using :global :normal and :substitute. Macros are a bit of a failure to think about a better way of doing things.
reply

Oh, also did you know that there is a :move command to move lines around? It's such a common task that you should absolutely use it. I have it set to move the current line up and down to alt+j/k
reply

dG will delete to the end of the file
/-Date will only find lines with Date at the very start of the line
and you can run macros over a visual selection
nice vid, thanks for all you do.

reply

Irrelevant question but which colorscheme are you using for vim? The dotfiles seem to be missing a call to colo [yourcolorscheme]. Im asking because it seems identical to the one I use.
reply

I like how the question is -How can I sort this file- and the answer isn-t simply :sort
I know the rest of the question is -...using something like a vim macro- but c-mon.

reply

Second macro: it's better to search for /-Date: to ensure to find the word Date at the beginning of any line. This way it wont mess up your file at the head of it
reply
Add a review, comment






Other channel videos