This VIM trick BLEW MY MIND

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ย. 2024

ความคิดเห็น • 289

  • @frknue
    @frknue 3 หลายเดือนก่อน +123

    thanks nerd

    • @SilentPongo
      @SilentPongo 2 หลายเดือนก่อน +2

      nerd

    • @G36_maid
      @G36_maid 2 หลายเดือนก่อน +2

      nerd

  • @_Grish
    @_Grish 3 หลายเดือนก่อน +259

    Another approach is to press qA (where A is the capital letter of the register where you saved the macro) and then press J. This appends J to the end of the sequence, resulting in: A,^[J

    • @lileightright
      @lileightright 3 หลายเดือนก่อน +10

      wow this actually works

    • @olivierbegassat851
      @olivierbegassat851 3 หลายเดือนก่อน +4

      Does this allow you to append a single character or more ?

    • @olivierbegassat851
      @olivierbegassat851 3 หลายเดือนก่อน +9

      Oh, you can append as much stuff as you want :D

    • @lileightright
      @lileightright 3 หลายเดือนก่อน

      @@olivierbegassat851 yeah no limit amazing stuff

    • @_Grish
      @_Grish 3 หลายเดือนก่อน +35

      Fun fact: This isn’t exclusive to macros; it works for registers in general! You can use this trick to append text while yanking, for example:
      1. Yank a line with yy
      2. Append another line to the same register with "Ayy"
      Now register a contains both lines.

  • @Rizhiy13
    @Rizhiy13 3 หลายเดือนก่อน +121

    BTW, you can just use `%s` as the whole file selector and replace newline with comma space: `:%s/
    /, /`

    • @Windeycastle
      @Windeycastle 3 หลายเดือนก่อน +11

      Yes, there are multiple ways to do all these tasks, and knowing more then 1 often comes in handy!

    • @canyonblue7735
      @canyonblue7735 3 หลายเดือนก่อน +12

      I tried to resist coming to the comments section just 30 seconds into the video and recommending this method but couldn't do it. Since you already did I'll just comment and like. 😃

    • @SmallSpoonBrigade
      @SmallSpoonBrigade 2 หลายเดือนก่อน

      Vi is the same way, there's just so much stuff that's baked in even before you run the entire file through sed or awk.

    • @warrenrexroad1172
      @warrenrexroad1172 2 หลายเดือนก่อน +1

      Don't forget the `| s/, $/` on the end to remove the trailing comma if the file ended with a newline!

    • @drishalballaney
      @drishalballaney 2 หลายเดือนก่อน +4

      a lot of times I Just use substitution instead of macros XD

  • @kode4food
    @kode4food 3 หลายเดือนก่อน +57

    I try to avoid yanking all over the place, for legal reasons

  • @achimwasp
    @achimwasp 3 หลายเดือนก่อน +30

    You can even use @a at the end of the macro itself (so end the recording with @aq) - just make sure the "a" register is empty before recording (by typing qaq). Once called, it will repeat itself to the end of the file. In this specific example you would end up with a comma at the end, though, which is probably not what you want.

  • @Temet79
    @Temet79 3 หลายเดือนก่อน +7

    That's huge as I can basically have a "macro.txt" file where I can save a bunch of macros and then just open the file and copy the actions in registries... love it.

    • @omairtech6711
      @omairtech6711 2 วันที่ผ่านมา

      Yeah, good idea. Thanks.

  • @GinoFazari
    @GinoFazari 3 หลายเดือนก่อน +11

    A couple extra tips:
    - To append to a register you can use the capitalized letter "Ay
    - In this case add to the macro with qA
    - If you need to edit it, you can paste straight from the register with "ap

    • @Windeycastle
      @Windeycastle 3 หลายเดือนก่อน +2

      Thanks nerd!

    • @magno5157
      @magno5157 3 หลายเดือนก่อน

      I don't understand. What's the difference between "appending" and "adding" to the register?

    • @GinoFazari
      @GinoFazari 3 หลายเดือนก่อน

      @@magno5157 same thing, i just used different words for some reason.

    • @Egzvorg
      @Egzvorg 2 หลายเดือนก่อน

      ​@@magno5157it's just different phrasing, I think, but you can either use qA or "Ay

    • @modernkennnern
      @modernkennnern 2 หลายเดือนก่อน

      ​@@magno5157Appending means to "add to the end of"

  • @josephangelodelosreyes4206
    @josephangelodelosreyes4206 3 หลายเดือนก่อน +10

    this is what i love about vim. you think you're efficient already, but there's always a new neat trick to learn every so often. :)

  • @ChrisCox-wv7oo
    @ChrisCox-wv7oo 3 หลายเดือนก่อน +31

    "I've yanked all over the place"
    phrasing!

    • @NElectronicSoul
      @NElectronicSoul 3 หลายเดือนก่อน

      it's all that item 8!

    • @SmallSpoonBrigade
      @SmallSpoonBrigade 2 หลายเดือนก่อน

      @@NElectronicSoul As long as it's not a random assortment of =,D and 8, it should be fine.

  • @lileightright
    @lileightright 3 หลายเดือนก่อน +8

    i love learning this native vim things rather then spamming plugins into my workflow, thanks

  • @noitibmar
    @noitibmar 3 หลายเดือนก่อน +5

    the number of times I've deleted a line to paste something in its place only to realise I just copied that line and pasted it back...
    Sideaffect of this video is I now know how to access multiple clipboard buffers and I will be abusing that.
    fantastic video

    • @typecraft_dev
      @typecraft_dev  3 หลายเดือนก่อน +1

      Yes!! Tons of registers that hold a lot of info

    • @aliventurous
      @aliventurous 3 หลายเดือนก่อน +2

      One way to avoid this is to use "0p which will paste the last thing you yanked. I tend to use visual mode to highlight the thing I want to paste over, instead of deleting and pasting

    • @modernkennnern
      @modernkennnern 2 หลายเดือนก่อน

      It takes time getting used to not deleting then pasting, ye 😂
      Just Vp instead

    • @Egzvorg
      @Egzvorg 2 หลายเดือนก่อน

      ​@@aliventurousif you use `:h v_P` for pasting it won't put the overwritten line in the default register, allowing you to repeat the replacement.

  • @user-fed-yum
    @user-fed-yum 3 หลายเดือนก่อน +62

    Tip: after you invoke @a the first time, which requires three button presses, you can then just press "." by itself to repeat the last command. One button press; and hold the key down for auto repeat. Helping those oldies with much more than 15 years programming experience, and their arthritic wrists and hands 😂

    • @cool_scatter
      @cool_scatter 3 หลายเดือนก่อน +9

      or just type a number first to do it that many times

    • @olivierbegassat851
      @olivierbegassat851 3 หลายเดือนก่อน +11

      For me the '.' doesn't work with macros ... I can repeat the same macro with @@ though.

    • @CNich90
      @CNich90 3 หลายเดือนก่อน +1

      Yeah same, at least in vscode vim extension the “.” doesn’t repeat macros for some reason.

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo 3 หลายเดือนก่อน +17

      . repeats last edit, last edit was a join, not the macro call.
      @@ is where it's at

    • @CNich90
      @CNich90 3 หลายเดือนก่อน +1

      @@ChrisCox-wv7oo thanks man for the clarification

  • @vivianludrick03
    @vivianludrick03 3 หลายเดือนก่อน +54

    Coincidently, I learned the same trick this week and was like "ig this vim journey ain't ending soon"

    • @no_name4796
      @no_name4796 3 หลายเดือนก่อน +5

      here's an other random trick you probably don't know: ctrl+6 to go to the previous buffer (very useful when you have two buffers and need to go back and forth)

    • @KENTOSI
      @KENTOSI 3 หลายเดือนก่อน

      @@no_name4796 That's super useful! Thanks.

  • @Hellbending
    @Hellbending 3 หลายเดือนก่อน +15

    This absolute CHAD, 0 care havin' ass beast, actually listed god damn 'meth' in his supposed shopping list. Your humor bro - I'll never get tired of it 🤣🤣🤣

    • @typecraft_dev
      @typecraft_dev  3 หลายเดือนก่อน +9

      Unfortunately Whole Foods was out of stock :(

    • @Hellbending
      @Hellbending 3 หลายเดือนก่อน +4

      @@typecraft_dev they keep it out the back- a bit towards the alley generally.
      Should be a guy somewhere around there but he won’t be wearing employee attire, they allow free dress.

    • @steeltormentors
      @steeltormentors 3 หลายเดือนก่อน +1

      There's a grandma somewhere in his shopping list...I don't know what to make of that 😮

  • @bambitsunami4165
    @bambitsunami4165 3 หลายเดือนก่อน +7

    You can also use ctrl-f to edit command-line mode commands or searches using vim motions! Eg :”compliaced command with mistake” then “ctrl f” to edit, then enter to run. Works with /“complicated search” too i think.
    the edits happen in whats called the “command-line window”.
    ctrl c (or :q) exits the command-line (or search) editing mode. (ie it exits the “command-line window”).
    edit: to learn more run “:help c_CTRL-f”!

    • @rugmj
      @rugmj 3 หลายเดือนก่อน +1

      This is so useful thank you

    • @bambitsunami4165
      @bambitsunami4165 3 หลายเดือนก่อน

      @@rugmj you’re welcome! to learn more run “:help c_CTRL-f”

    • @MatthieuPETIOT
      @MatthieuPETIOT 3 หลายเดือนก่อน +2

      In normal mode you can do q: to get last commands, q? or q/ to get last searches.

    • @Egzvorg
      @Egzvorg 2 หลายเดือนก่อน +1

      it's command-line window. Command mode is a synonym for Normal mode.

    • @bambitsunami4165
      @bambitsunami4165 2 หลายเดือนก่อน

      @@Egzvorg oh interesting, thanks! i corrected my comment to say “command-line window” instead of “command mode window”, and “command-line mode” instead of “command mode”

  • @henrymisc
    @henrymisc 3 หลายเดือนก่อน +3

    Man, Vim never seizes to surprise me. There's always more to learn!

  • @LoricBrevet
    @LoricBrevet 2 หลายเดือนก่อน

    In kakoune, that would just be: `%i,` (for selecting the whole buffer, joining lines and making a selection for each space inserted, and then inserting a comma and return to normal mode)

  • @theIbraDev
    @theIbraDev 3 หลายเดือนก่อน +2

    It’s so intresting seeing you film this live on twitch. Such an inspiration

    • @typecraft_dev
      @typecraft_dev  3 หลายเดือนก่อน +2

      Glad you enjoyed it!

  • @abag0fchips
    @abag0fchips 3 หลายเดือนก่อน +28

    i get this tutorial is for editing vim buffers and it was just an example, but the actual easiest way to do this is to type ":%s/
    /, " instead. substitute, match newline, replace with comma space.

    • @lileightright
      @lileightright 3 หลายเดือนก่อน +2

      this is nice its working but if there is other content in the buffer it will apply to all.

    • @DeathStocker
      @DeathStocker 3 หลายเดือนก่อน +4

      You can also apply the substitution to a visual selection

    • @abag0fchips
      @abag0fchips 3 หลายเดือนก่อน

      @@lileightright yeah but in the event you have more lines with different content you can use more specific regex to describe the lines you want to modify. You can also use a format like this to only modify what you have selected in visual mode :%s/\%VSEARCH/REPLACE/g

    • @lileightright
      @lileightright 3 หลายเดือนก่อน

      @@abag0fchips i tried this when highligheted but for some reason it not working :'

    • @Noname-67
      @Noname-67 3 หลายเดือนก่อน +1

      If you select your area and type the colon, the command line will become `:'

  • @joshualeefyi
    @joshualeefyi 7 วันที่ผ่านมา

    So literally the first video I've watched on VIM. and you were the first video in that search algorithm, Surprising that there's only 285 comments, and it's almost two months old. I would definitely say comment. Any questions? So on and so forth. But new to all of this I can't even type like a normal person. I'm picking peck and I use voice to text for this. because I'm computer illiterate in a sense that. I have a hard time communicating with my machine. I Feeding into plans, feeding into inventions, feeding into whole I could go on about but anyhow, thanks for the video. You earn my subscription. Have a blessed day.

  • @silak33
    @silak33 3 หลายเดือนก่อน +12

    You could also have tried qA.
    Like when you yank into an upper case registry it will append what you do to the registry rather than overwriting it.

    • @edonan85
      @edonan85 3 หลายเดือนก่อน

      very useful, thank you!

    • @MatthieuPETIOT
      @MatthieuPETIOT 3 หลายเดือนก่อน

      Thanks, this one is very useful.

    • @lian1238
      @lian1238 3 หลายเดือนก่อน

      Only nerds would know this. I am now a nerd. 😂

  • @KingZero69
    @KingZero69 3 หลายเดือนก่อน +2

    that’s a cool tip, and i actually use this all the time… but you should have ended it by saying you can just type “7@a” and get all the lines to concat in one command by multi-running the macro instead of having to type “@a@a@a@a…” like a goon 😏(it’s also useful to know “@@“ reruns the last macro you ran)

  • @BergenVestHK
    @BergenVestHK หลายเดือนก่อน

    I know the video is about editing registers, but I see several people here talking about different methods of joining lines, so I'll just add mine.
    To join all lines with a comma inbetween, my go-to is to just do:
    :%!paste -sd,
    It rolls off the fingers so fast, it's done within a second. And it takes the whole file in one swoop, no need to record a macro and play it back X amount of times.
    The only drawback (at least for my use case) is that it can only take one delimiter (in this case a comma), so if I want, let's say, both a comma and a space, I need to do something else. But for my use case, which is just joining lines with a comma, this is sooo smooth.

  • @DaneBurchette
    @DaneBurchette 3 หลายเดือนก่อน

    I literally found out about this same thing a couple weeks ago and it changed my life. I love these tricks with vim

  • @ildarakhmetgaleev
    @ildarakhmetgaleev 2 หลายเดือนก่อน

    In Helix this task could be done like:
    % - select all;
    - split selection by new line;
    ( - make last selection the active one;
    - deselect active selection;
    a, - add coma after each remaining selection;
    - collapse line after each remaining selection;
    ;, - reset selections to single character cursor.
    The trick with macro as buffer also works in Helix.

  • @aidhoss
    @aidhoss 2 หลายเดือนก่อน

    In addition to others mentioning appending to the a register/macro using `qA`, you can also append to it a call to play itself back with `@a`, so the full a register becomes `A^[J@a`. Then play it once and it will continue recursively calling itself, joining lines until there are no more to operate over and then it will exit.

  • @kacperkwasny3848
    @kacperkwasny3848 3 หลายเดือนก่อน +2

    woooow sooo cool.
    I realy feel that youtube finally got saturated with 101 tutorials and more content on advanced stuff is being created! Soo cool :D

  • @panosp57
    @panosp57 3 หลายเดือนก่อน +7

    I hate the fact q was used for this as I often end up wanting to quit and instead I'm now fighting to get out of the macro input/mode

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo 3 หลายเดือนก่อน +1

      don't fight. just quit. macro recording isn't inhibiting you.

  • @romanaxle
    @romanaxle 3 หลายเดือนก่อน +2

    “I’m yanking all over the place”
    Same, buddy. Same.

  • @jefferyosei101
    @jefferyosei101 3 หลายเดือนก่อน +1

    Can't wait to see this channel grow. You're awesome 🎉

    • @typecraft_dev
      @typecraft_dev  3 หลายเดือนก่อน +1

      Thanks!! 100k here we come!

  • @tintindb
    @tintindb 3 หลายเดือนก่อน +1

    First. Fantastic content!
    Second. Really funny I had to do this about a month ago and as you put it vim is an amazing piece
    Of tech. After I did the macro I had to to restrain myself from burning incense and chanting.
    Third. Not to dump on vim but you can do the same thing with Helix. But that is black magic of which we shall speak of no more.
    Requiring sacrifice... But let us speak no more of it!
    Fourth: cigarettes? Lol.

  • @CNich90
    @CNich90 3 หลายเดือนก่อน

    This was a revelation for sure lol really takes the mystery out of vim macros, I use them all the time but now it makes sense how it works under the hood.

  • @WillEhrendreich
    @WillEhrendreich 3 หลายเดือนก่อน

    great stuff, keep it coming! I'd love more macro and vim regex magic stuff.

  • @fgodek1964
    @fgodek1964 2 หลายเดือนก่อน

    If the list is large, you can also call another macro at the end of your macro to make your original macro repeat. For example, if macro a is A,^]J@b and macro b is @a, it will repeat macro a until the list is done. I've done this in vi since back in the 1980s.

  • @ozkifovxvypyvp3574
    @ozkifovxvypyvp3574 หลายเดือนก่อน

    Probably already been mentioned that you can execute a macro multiple times by putting a number before invoking a macro, eg - 10@a. Didn't know about manually editing a macro, that's cool, same with the register view. Always something to learn with Vim.

  • @JamesDHendrickson
    @JamesDHendrickson หลายเดือนก่อน

    When you said what's the easiest way to put all of these onto one line with a comma and a space delimiting them all I could think of was ":%s/
    /,\ /g" and I got mildly gruntled (I know it means happy but it's funnier than disgruntled) when you mentioned macros... until my autistic ass realized you were just using it as an excuse to teach about editing macros, lovely video, it got my sub I enjoyed your presentation.

  • @tristansnow
    @tristansnow 3 หลายเดือนก่อน +2

    You pasted the register using the :put command, and I hadn't seen this before. I just use the inverse of yanking to the register, and paste from it using: "ap to paste from register a.

  • @baronvontrap3325
    @baronvontrap3325 3 หลายเดือนก่อน +4

    I didn’t know that you can edit macros either and I’ve been using vi/vim since 1988 …

  • @yinjs
    @yinjs 3 หลายเดือนก่อน +1

    less steps to modify register
    1. command mode type let @a=‘
    2. ctrl+r a
    3. edit macro, then add ‘ at the end, press enter

  • @JarheadCrayonEater
    @JarheadCrayonEater 2 หลายเดือนก่อน +13

    I've been a developer for 38 years.
    Hearing "15 years" and then "I'm getting so old" was ridiculous.

    • @luquest1848
      @luquest1848 2 หลายเดือนก่อน +3

      46 for me, you young whippersnappers XD (no cap!

    • @JarheadCrayonEater
      @JarheadCrayonEater 2 หลายเดือนก่อน

      @@luquest1848, ha! I just turned 47!
      Yep, got it right!

    • @legion_prex3650
      @legion_prex3650 2 หลายเดือนก่อน +1

      me too!

  • @OfficialSkankyRich
    @OfficialSkankyRich 3 หลายเดือนก่อน +3

    Keep yanking fellas!

  • @thecoderguy_0001
    @thecoderguy_0001 3 หลายเดือนก่อน +1

    you can go to visual or visual-line mode and select till the second last(ig) and do a single @a instead of pressing multiple @a 's

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo 3 หลายเดือนก่อน

      Because you are modifying line count as the macro is run, this does not work.

  • @FoWDarthLi
    @FoWDarthLi 2 หลายเดือนก่อน

    I know about this for a long time, but I rarely use it because it's mostly shorter to just do the macro again. If your macro is simple it doesn't take long to just do it again. If it's long and you edit the macro as text you don't see what will actually happen during editing and will often do a mistake so again it's often faster to just do the macro again.

  • @koushikm
    @koushikm 2 หลายเดือนก่อน

    I can't explain how many doors this opens for me. I never get macros first time right - that alone is a big win. Thanks a lot!

    • @typecraft_dev
      @typecraft_dev  2 หลายเดือนก่อน

      Love hearing comments like this! We love shining a light on techniques that are easily missed or overlooked.

  • @vidal9747
    @vidal9747 3 หลายเดือนก่อน +1

    It's weird how I always thought that I was doing things slow in vim. Some day, suddenly, I realized I was getting fast. It is weird how suddenly it was. I am not TH-camr level fast, but I can perceive input delay in different terminal emulators fast. I don't know, I kind of had an epiphany and can do everything faster suddenly.

  • @no_name4796
    @no_name4796 3 หลายเดือนก่อน +4

    Prewatched the stream

  • @luccaugusto
    @luccaugusto 3 หลายเดือนก่อน +1

    i'd j CTRL+V G I , gg 7 J. Love macros but that's what came to mind first, to me it's a bit more intuitive than making a macro. Loved the trick too, didn't know it before

    • @petrpechkurov3095
      @petrpechkurov3095 3 หลายเดือนก่อน +1

      It could also be C-V G $ A , 7 J

  • @bambitsunami4165
    @bambitsunami4165 3 หลายเดือนก่อน +1

    Also @: and @@ are cool!
    @@ repeats the last macro and you can also do @: to redo the last command mode command! Eg :vsplit, then @: to repeat :vsplit, and then @@ will repeat it more haha.
    although, : also redo’s a command, and might be faster for one redo, i like @@ for multiple redo’s. i think i can even give it a count like 5@@.

  • @sywtf4
    @sywtf4 2 หลายเดือนก่อน +1

    You had me at "Whole Foods" purchase... did not know they had cigs and meth. Guess I need to get out more.and get me a grandma ;-) - love your vids.

    • @typecraft_dev
      @typecraft_dev  2 หลายเดือนก่อน

      Whole Foods has the organic stuff. It’s a little pricey but worth it

  • @savagepro9060
    @savagepro9060 3 หลายเดือนก่อน +2

    typecraft: "This VIM trick BLEW MY MIND"
    Cocaine: 🤔🤨 Hmm, so you're sniffing a household kitchen cleaner, eh?

  • @TheBearmoth
    @TheBearmoth 2 หลายเดือนก่อน +1

    "I'm yankin' all over the place"
    And here I was, thinking this was a family friendly channel 😂

  • @nerdydrow
    @nerdydrow 3 หลายเดือนก่อน +1

    you can also press a number before @ to tell vim to run the macro that many times like 6@a

  • @Steerable6827
    @Steerable6827 3 หลายเดือนก่อน +2

    "I'm yankin all over the place"

  • @prdoyle
    @prdoyle 2 หลายเดือนก่อน

    Vim is hard to learn and hard to master, but there's this huge inbetween phase where you're super productive.

  • @Hornet1806
    @Hornet1806 2 หลายเดือนก่อน

    Macros are good for later-replayability but I rarely use them. Instead for something like this I'd use visual-column mode or substitute. %s/
    /, /g, A does the trick. Or gg, ^v, G, $, A, ,, , G, $, x . Takes ~1s to type that out once you understand what you're doing.

    • @ozkifovxvypyvp3574
      @ozkifovxvypyvp3574 หลายเดือนก่อน

      Was going to say this as well. Visual mode has some fun tricks that work out nicer in my opinion that macros for certain things and is easier to do than remembering vim regex specifics.

  • @CarlosReyes-ku6ub
    @CarlosReyes-ku6ub 3 หลายเดือนก่อน +1

    Dude, you're almost 100k, I miss the early days when we talked about Emacs...

  • @edding8400
    @edding8400 3 หลายเดือนก่อน +1

    "Grandma" is on the shopping list

  • @suede__
    @suede__ 3 หลายเดือนก่อน +1

    When you run the macro you can also tell it the number of times to run like when moving down multiple lines

  • @michakozio7460
    @michakozio7460 3 หลายเดือนก่อน

    This is why '@:' will replay your last command mode action.
    You can think that '@' as 'play' and then submit the register with the contents to execute.
    And the ':' in this case is your last action from command mode.

  • @readyplayer2197
    @readyplayer2197 3 หลายเดือนก่อน +1

    Im not joking, my cat just subscribed to your chanel. I didnt know it knew vim.

  • @sasakanjuh7660
    @sasakanjuh7660 3 หลายเดือนก่อน +1

    Prepare your mind to be blown again, because you can also select all the rows/lines in a visual mode, then type ": norm! @", and it will perform the macro saved in on all selected lines :) In this case, though, since it's running macro on each consecutive line, it will actually only append two words per line, so this was obviously not a perfect example, but still, super useful trick.. What you can do instead, is make a macro append only "," at the end of the line, use previously explained approach to run that macro on all the lines (which will effectively append "," to each of them), then select all the lines again in visual mode and just press "J", it will do the trick :)

  • @nightfox6738
    @nightfox6738 2 หลายเดือนก่อน +2

    1:05 No the easiest way to do that is :%s/
    /, /g
    Also please don't do @a@a@a. 8@a will do all the lines

  • @muddyexport5639
    @muddyexport5639 3 หลายเดือนก่อน +1

    Good news, thanks!

  • @luispedrocamacho
    @luispedrocamacho 3 หลายเดือนก่อน

    Thanks for sharing!

  • @IsraelFraga
    @IsraelFraga 3 หลายเดือนก่อน

    this is a cool feature, but it's also something that i never had the change to use well tbh, i use a alt layout and had to move hjkl around, so editing registers is quite the mental work to translate everything. maybe the langmap feature should also do this translation, but macro just doesn't work with it, i may try to get the repo and try out some ideas for this situation 🤔
    bonus thing: Q can be a macro for @q, so i always use it as a quick macro register thanks to it. a macro to start a macro? is this macroception?

  • @shahwan42
    @shahwan42 2 หลายเดือนก่อน

    Thanks. That was useful.

  • @bagfleet
    @bagfleet 3 หลายเดือนก่อน +1

    Great vid, thanks nerd!

  • @urizen959
    @urizen959 3 หลายเดือนก่อน

    OG knows title was changed and still rewatch it again cos why not

  • @gh0stzk-dotfiles
    @gh0stzk-dotfiles 3 หลายเดือนก่อน

    How not to love this guy!

  • @fcpolon1a543
    @fcpolon1a543 3 หลายเดือนก่อน +1

    The OGs saw it being filmed

  • @TheBigW300
    @TheBigW300 2 หลายเดือนก่อน

    you can also make macros recursive so that they call themselves and one call to it will go through the whole file.

  • @simonlauer9379
    @simonlauer9379 3 หลายเดือนก่อน +1

    I am yanking all over the place
    kind of sounds dirty

  • @PetrenkoAndrii
    @PetrenkoAndrii 3 หลายเดือนก่อน

    Cool video! Thank you!

  • @MySisterIsASlytherin
    @MySisterIsASlytherin 2 หลายเดือนก่อน +1

    Is nobody gonna talk about that shopping list?

  • @jasonbeermaker4980
    @jasonbeermaker4980 3 หลายเดือนก่อน +2

    15years 😂 - your only just starting I’m close to 40years and used vi (the original) then moved to vim and now to neovim

  • @Ziggurat1
    @Ziggurat1 3 หลายเดือนก่อน +1

    Can you make videos about nixos?

  • @britneyfreek
    @britneyfreek 3 หลายเดือนก่อน

    in sublime i just use column editing for the commas and then join the lines. i program for 20 years and can’t get accustomed to having to remember all those vim gymnastics. still interesting nontheless.

  • @PhrontDoor
    @PhrontDoor 2 หลายเดือนก่อน

    For the first 8 lines.. I'd do :
    move to beginning of apple... then
    :s/
    /,/g 8
    that changes the new lines to commas for 8 lines.

  • @KevinONeillPlus
    @KevinONeillPlus 3 หลายเดือนก่อน +1

    lol .. 15 years .. a teenager thinking they are “old”. I’m at 45 years and still going strong, most of that time I’ve been a vi of some kind user.

  • @AverageNeovimEnjoyer
    @AverageNeovimEnjoyer 3 หลายเดือนก่อน

    Great Vid!

  • @reapersenpaix99
    @reapersenpaix99 3 หลายเดือนก่อน +1

    ig i learned 2 more things today 🤯

  • @sharp764
    @sharp764 3 หลายเดือนก่อน

    Coincidentally I learned this after watching this video

  • @dermozart80
    @dermozart80 2 หลายเดือนก่อน +1

    Who doesn't want to purchase a grandma?? I mean, everyone could use one, so why not...

  • @oglothenerd
    @oglothenerd 3 หลายเดือนก่อน +2

    I use Helix, btw.

  • @LeLouchMania
    @LeLouchMania 3 หลายเดือนก่อน +1

    Hmm groceries in vim 🤯🤯🤯

  • @jrtomsic
    @jrtomsic 3 หลายเดือนก่อน

    This is one that I've known about for a while. Something I haven't figured out is how to replicate the ^[ esc character if I want to, for instance, add an escape keypress somewhere in the middle of my pasted macro. I think using the capital register to append the esc char, then moving that character elsewhere is probably the easiest way, but I wonder if there's an easier one.

    • @granthammond804
      @granthammond804 3 หลายเดือนก่อน +1

      Ctrl_v Esc

    • @lpanebr
      @lpanebr 3 หลายเดือนก่อน

      @@granthammond804 I was going to say Ctrl+R Esc but now I'm uncertain. Gonna have to try it.

  • @neoplumes
    @neoplumes 2 หลายเดือนก่อน

    But, what about ctrl+v jjjjjj shift+I backspace ,
    Visually selecting seems easier than a macro?

  • @danieloverstreet7625
    @danieloverstreet7625 2 หลายเดือนก่อน

    J blew my mind, very cool

  • @timidlove
    @timidlove 3 หลายเดือนก่อน +1

    maybe do a regex substitution simpler?

  • @softwaresirppi
    @softwaresirppi 3 หลายเดือนก่อน

    in kakoune that would be four keystrokes %r,

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo 3 หลายเดือนก่อน

      Not working for me (I don't use kakoune, using fairly old version 2022.10.31). Subs all char with ,
      I had to do %sc,
      10 char
      Vim
      :,+ns/
      /,
      13 char

  • @mrmakra-eo1kx
    @mrmakra-eo1kx 2 หลายเดือนก่อน

    before watching what you are going to say how i would do is
    select all the lines then :norm A,
    this would add comma to the end of line of every selected lines
    and now just press J couple of times and done
    oh yeah maybe delete the last comma at the end.
    edit: oh the video is about macro registers

  • @irlshrek
    @irlshrek 3 หลายเดือนก่อน +4

    also, if you press ".", the period, itll redo your last command. so you can do @a and then a bunch of periods to redo it

    • @silak33
      @silak33 3 หลายเดือนก่อน

      you can also use @@ for redoing the last macro you used

    • @matthewr8502
      @matthewr8502 3 หลายเดือนก่อน

      Years ago I read a really good book on vim and the first chapter was all about how powerful the . command is.

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo 3 หลายเดือนก่อน

      . repeats last edit, which was a join.
      @@ to replay macros

  • @siuyutpang2335
    @siuyutpang2335 2 หลายเดือนก่อน

    oh, you can edit macro in vim, awesome

  • @um8078
    @um8078 3 หลายเดือนก่อน +1

    did no one notice the end of the list

  • @dshaf7
    @dshaf7 2 หลายเดือนก่อน

    “The history of the things I’ve yanked” 😅

  • @StevenWaltonj
    @StevenWaltonj 2 หลายเดือนก่อน

    $GkA,VGJ
    or faster
    :1,$-1s/
    /, /g
    Also, ^[ isn't "a special character that means escape" it __is__ escape. You can press ctrl + [ (

  • @TheRoseWoodBody
    @TheRoseWoodBody 2 หลายเดือนก่อน

    yank here, yank there, yank yank everywhere

  • @sean721888
    @sean721888 3 หลายเดือนก่อน +2

    You been programming since 10 yrs old?

    • @typecraft_dev
      @typecraft_dev  3 หลายเดือนก่อน +1

      I’m actually 76 years old

    • @sean721888
      @sean721888 3 หลายเดือนก่อน

      @@typecraft_dev you look great at 76!! Didn’t know using Arch and Vim can make you look so much younger

  • @YannMetalhead
    @YannMetalhead 2 หลายเดือนก่อน

    Good tip.

  • @0xc0ffee_
    @0xc0ffee_ 3 หลายเดือนก่อน

    I think in visual mode the capital J turns multilines into a single line by default in vim LOL