How To Use Vim/Neovim Macros For Next Level Productivity

  Рет қаралды 11,560

Josean Martinez

Josean Martinez

Күн бұрын

Everything you need to know about Vim/Neovim to take your productivity to the next level and make it a lot easier & faster to complete repetitive tasks. Hope you enjoy it!
💻 Dotfiles: bit.ly/4cFlPyq
🎥 How I Setup Neovim: • How I Setup Neovim To ...
📧 Subscribe To My Newsletter: buttondown.email/josean
☕️ Help Support Me And The Channel: www.buymeacoffee.com/joseanma...
⏰ Timestamps
00:00 - introduction
00:18 - registers
01:57 - macros overview
03:08 - modifying macros
04:07 - repeatable macros
07:04 - appending to macros
08:18 - combining macros
09:23 - conclusion

Пікірлер: 49
@joseanmartinez
@joseanmartinez 10 күн бұрын
Hey guys! After making this video, I realized that the repetitive nature of the macros I showed here isn't precisely recursive. To make a macro recursive, it needs to call itself. This will make the macro execute until it reaches the end of the file or doesn't fulfill a certain condition. Its essentially the same as doing something like 100@r to change 100 console.logs as in the video, but instead of specifying a number of times to repeat, the macro just calls itself and will execute until there are no more "console.logs" left. You can learn more about this here: vim.fandom.com/wiki/Record_a_recursive_macro.
@manrique.varela
@manrique.varela 10 күн бұрын
Great video, I didn't know macros were saved in registers I learn so much with your content, keep up with Vim videos.
@joseanmartinez
@joseanmartinez 10 күн бұрын
Happy to hear that!
@moomincare
@moomincare 10 күн бұрын
Finally, a new video! I've been eagerly waiting for your content. Your videos are always amazing. Keep up the great work!🎉🎉
@joseanmartinez
@joseanmartinez 10 күн бұрын
Thank you!! Sorry about the delay, I was out of office for a couple of weeks.
@stoicfloor
@stoicfloor 7 сағат бұрын
Thank you so much for this video! Finally some vim/nvim content that is not for complete beginners. I have been using nvim for years and I didn't know about pasting and editing macros; they made me go "wow!" while watching your magic. I relly enjoy this video format of yours; such high quality video output. Keep up the great work!
@joseanmartinez
@joseanmartinez 6 сағат бұрын
Thank you!!
@jeppe7328
@jeppe7328 6 күн бұрын
Golden content, straight to the point!
@user-hh4br5tk5p
@user-hh4br5tk5p 10 күн бұрын
This is great. Thank you so much as always!
@samyak039
@samyak039 9 күн бұрын
good video, was pretty informative. been using vim/neovim for about ~5 years, but didn't explored the macro in this depth. enjoyed it and learned too!
@alfredomenezes8814
@alfredomenezes8814 9 күн бұрын
Really nice to know that, thank you!
@robertojimenez8412
@robertojimenez8412 7 күн бұрын
love this video❤ concise but pretty useful
@joseanmartinez
@joseanmartinez 7 күн бұрын
Happy to hear that!
@dixitvara
@dixitvara 9 күн бұрын
One thing you can do, you can repeat the last action if you press period ( . ) so you don’t have to repeat the same thing again
@JoshMedeski
@JoshMedeski 10 күн бұрын
Great video! Macros are so powerful, it's a helpful reminder that they can be overwritten and you can even dump the output, thanks!
@joseanmartinez
@joseanmartinez 7 күн бұрын
Thanks Josh!
@adamdrake39
@adamdrake39 9 күн бұрын
Finally a video really explaining macros and registers nice and clearly. Great stuff!
@joseanmartinez
@joseanmartinez 9 күн бұрын
Thank you!!
@ariasalmeida
@ariasalmeida 7 күн бұрын
Thank you Josean !
@colin0516
@colin0516 7 күн бұрын
the @@ feature blew my mind. I record macros quote often, can't believe the concept of @@ has been right under my nose!
@joseanmartinez
@joseanmartinez 7 күн бұрын
Yes! I actually learned about it recently too!
@sarojregmi200
@sarojregmi200 10 күн бұрын
Learnt some new motions looking at the video, great video thanks
@joseanmartinez
@joseanmartinez 10 күн бұрын
Awesome!
@FrancoisKerisit
@FrancoisKerisit 10 күн бұрын
Great video, thank you ! I did not know macros were saved in register and editable.
@CodingWithAuryn
@CodingWithAuryn 9 күн бұрын
Thank you for this video :) i am a heavy daily vim user and still learn something :) Greetings
@machinima1402
@machinima1402 10 күн бұрын
Hi Josean! Love the way you explain in your videos. In neovim 0.10.0 my most recent contribution to the core was added where you can apply recorded macros to each visually selected line. This should work as well with multi-cursor selection :) Hope you find this useful. Sidenote: i'm trying to grow a streaming channel programming a few OSS contribs, do you mind if i add the channel to a reply in this comment? it's a bilingual channel.
@joseanmartinez
@joseanmartinez 10 күн бұрын
That’s awesome! Thanks for your feedback 🙏🏽 And sure thing, you can post the channel as a reply here
@machinima1402
@machinima1402 10 күн бұрын
@@joseanmartinez Thank you very much! The channel is "whodiscode" :) hope to see you there sometime
@supermeia28
@supermeia28 10 күн бұрын
Great video
@joseanmartinez
@joseanmartinez 10 күн бұрын
Thank you!
@codingwithrendi
@codingwithrendi 8 күн бұрын
you make me obssessed with neovim, so i can tell everyone : "I use neovim btw :)"
@joseanmartinez
@joseanmartinez 7 күн бұрын
🚀
@davidgroskind3233
@davidgroskind3233 8 күн бұрын
It looks like if you want to save your macro to use in the future, you have to open a new empty file, paste the register contents into the file, and save the file somewhere. To reuse the macro, you open the file where you want to use the macro, read the contents of the macro file into the file, and yank the line just added into a register as shown, and run the macro as shown. Seems like there should be a simple way to write the content of a register to a file the way you can write the contents of a file to a new file and a simple way to read the contents of a file directly into a register the way you can read a file into a file.
@sayanta01
@sayanta01 7 күн бұрын
which terminal font are you using ?
@ErmandDurro
@ErmandDurro 10 күн бұрын
Amazing content. I really enjoyed it 😃 I learned a couple of things that I didn't know, such as pasting the content of the macro, modify it and add it back. Very convenient. May I ask you what layout are you using for your corne? Would you mind sharing it? 😃
@joseanmartinez
@joseanmartinez 10 күн бұрын
Thank you! That’s great you learned some new stuff! This should be my layout: github.com/qmk/crkbd_rev1_3x6_josean.json. You can upload it to the qmk online configurator.
@ErmandDurro
@ErmandDurro 10 күн бұрын
@@joseanmartinez Great! Thanks a lot 😃
@RYKalmante
@RYKalmante 10 күн бұрын
Hi Josean, I hope you can find the time to create a Svelte tutorial.
@chrissmith6028
@chrissmith6028 10 күн бұрын
Do you have your config dotfiles available? I have hand written mine but just happy with them. Well except my hotkey for insert iso current date time.
@joseanmartinez
@joseanmartinez 10 күн бұрын
Yes! Here you go: bit.ly/4cFlPyq
@sadeepa_bandara
@sadeepa_bandara 3 күн бұрын
Hey josean, I finished my nvim configuration but when I open my project it shows [lspconfig] unable to find ESLint library. I think because of that it shows so many red error like Cannot find module 'react/jsx-runtime'. can you help me please. Thanks in advance ❤ Additional: when I press space+ff it pop up find files window but when I search there it doesn't show any results. Please I need help for these ones. Update: my fzf is not working properly it shows: [Command failed: rg --files --hidden --glob "!.git/*"]
@gbarkhatov
@gbarkhatov 10 күн бұрын
Hey mate, what about a video about Helix?
@mathiaz943
@mathiaz943 9 күн бұрын
Fantastic!
@joseanmartinez
@joseanmartinez 7 күн бұрын
Awesome, thanks!
@chimeces
@chimeces 9 күн бұрын
No love for @@ ? If you want to repeat the last macro you run, you can just tap @@ and it will run it, very useful for repeating macros! And @ has more magic! Try combining it with the other special registers, like @: to run the last command line command you ran!
@joseanmartinez
@joseanmartinez 9 күн бұрын
I mention @@ in 3:05. Thanks for the tips!
@chimeces
@chimeces 9 күн бұрын
@@joseanmartinez I missed it! :D great video 👍
@joseanmartinez
@joseanmartinez 9 күн бұрын
@@chimeces thank you! 🙏🏽
7 Amazing CLI Tools You Need To Try
18:10
Josean Martinez
Рет қаралды 262 М.
A Powerful Way To Make Editing Code In Neovim Even Better
17:48
Josean Martinez
Рет қаралды 115 М.
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 35 МЛН
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
Was ist im Eis versteckt? 🧊 Coole Winter-Gadgets von Amazon
00:37
SMOL German
Рет қаралды 36 МЛН
Как быстро освоить Vim / Neovim?
23:31
PurpleSchool | Anton Larichev
Рет қаралды 50 М.
The Ultimate Beginner’s Guide To Learn And Master Vim
33:56
Josean Martinez
Рет қаралды 44 М.
How to ACTUALLY switch from VS Code to Neovim
5:09
Joshua Morony
Рет қаралды 188 М.
Everything Starts with a Note-taking System
21:23
Mischa van den Burg
Рет қаралды 108 М.
How To Make Your Boring macOS Terminal Amazing With Alacritty
16:33
Josean Martinez
Рет қаралды 129 М.
This cli component was trickier to build than I thought
17:34
Dreams of Code
Рет қаралды 51 М.
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 42 М.
Clicks чехол-клавиатура для iPhone ⌨️
0:59
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 7 МЛН