Vim Macros Are A Game Changer
Ғылым және технология
In this video we look at vim macros and how to use them to speed up our coding speed.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/
Пікірлер: 38
pro tip: any time you want to delete two lines use dk or dj. it deletes the line you're on and the line you move into. d is on the left hand and j/k is on the right, so it's super fast, especially compared to "dd dd" (which only works from the top)
@sp3ctum
5 ай бұрын
For double speed you can also do dj. (dj and the repeat operation). I like the feeling of rolling this with my fingers
you can do arithmetic operations with vim: in insert mode press ctrl-r and then =. if you want to add 100 to all the numbers, yank the number (in the macro in this case), go into insert mode, go into arithmetic mode, paste the number you yanked and add + 100 (enter), exit insert mode, delete the original number which is now at the end of the arithmetic result and you're done. this is a more general way of doing it than repeating things like ctrl-a. you can also do operations with floating points, just add decimal indicator with .0.
vim macros could be useful in C++ where you have to want to write declarations inside the class, and definitions outside the class. You can record a macro that copies the declaration, and creates an empty definition. Then you can repeat it for all such methods.
They totally are. At my job we collapse SQL migrations every release cycle and using vim macros made converting a huge sql script to generate dozens of tables to a list of strings take a couple minutes as opposed to 30+ manually haha.
Hey! Thx for your video man, specially being so open about letting the macros fail live. It has given me a better feeling of what actually using macros feels like.
Very useful video, thanks!
great video tks !
Super, danke!
Wow, very cool, need more complex macros, vim is the best editor
Really useful! But couldn’t help but feel like introducin this to my team will leave them saying “that could be done w python”
Cool Microphone. Is it still available? Excuse me for off topic.
German accent + German book shelves + German vimming = perfection
@NeuralNine
4 ай бұрын
Austrian* :)
How long have you been using vim?
I have NVIM v0.9.5, but when I input [ vim.cmd('set number') ], and try to source it, it doesn't allow me to. I installed neovim through homebrew. Has anyone encountered this?
How can one format text in vim? More than indenting; like I would like my code to follow the doom document; 1 space inside brackets amongst others. As pr example: func myFunc( parameter: Int ) {} I hate the way Apple XCode reduces legibility by func myFunc(parameter: Int) {} I know I can make macros for this, however there should be a way to [ab]use LSP.
Hey dude, Would you be able to show us how to create a user form for example which acts as a front end entry that uses Google Sheets as a database? That would be cool.
@ralphlagos4210
2 жыл бұрын
You mean google forms
@thecodfather7109
2 жыл бұрын
@@ralphlagos4210 but instead of a Google form, a GUI which connects to the Google sheets API
The blogs were 😀👍🏻
Why you don't create a repo for this video, to take the dummy data for test?
any tips on getting motivation to learn vim?
@aymancassim8944
2 жыл бұрын
You can 1st start by using the extensions from like VsCode or Pycharm cause at 1st it will be difficult to know the exact keybinds, so you can revert back easily if you dont know a specific keybind, it will be easier and then you will be able to build up muscle memory for the keybinds
@NeuralNine
2 жыл бұрын
Look at George hotz coding for an hour. Also, learning vim takes a week or two max if you commit
How to get the index numbers like 4321234 in vim ?
how to use qa, q etc in anaconda jupiter while typing should we use 'control' and then type q and a kindly clarify it
@thepaulcraft957
2 жыл бұрын
i dont know this specific case, but normaly you have to press ESC to get in normal mode and using all this keybinds
WOW
Hello
Nice one, too bad the first example can be solved with g+Ctrl-a, makes it less satisfying to solve with a macro
@philpeko1796
9 ай бұрын
Which example, please, and how so?
@Blattealkiller
9 ай бұрын
@@philpeko1796 The one with the macro where he increments the numbers on each line (i.e at 3:55). You can instead do the same thing of copying all lines, visually select them, and press g+Ctrl-a
@philpeko1796
9 ай бұрын
@@Blattealkiller Nice! Thank you very much. ❤👍🖖
Which time you convert to islam
Nacho
Coding speed? No one codes at 60 wpm. You’re not writing an essay. Coding is slow and deliberate. So what if you saved 20 seconds not repeating yourself when you send 20 min googling your problem.
In Jesus' Name Amen ✝️