Vim is Amazing | Editing for Automation!

  Рет қаралды 2,668

IPvZero

IPvZero

Күн бұрын

Пікірлер: 17
@ana.tomasovic
@ana.tomasovic 4 жыл бұрын
Never realized how useful relative numbering could be until now. Thanks for the great overview!
@IPvZero
@IPvZero 4 жыл бұрын
Glad it helped, Ana! Yup, relative number is a lifesaver haha! -John
@SuperLisitsin
@SuperLisitsin 4 жыл бұрын
This is a great overview of power of VIM. I am a big fan of it, but didn't know most of what you have shown. :)
@IPvZero
@IPvZero 4 жыл бұрын
Thanks Sergey! Vim is amazing. I'm always finding out new cool features I never knew about either :) -John
@bodgit40
@bodgit40 4 жыл бұрын
You used 'd500j' to delete to the end of the file, assuming 500 would be enough. In vim the 'G' command takes you to the end of file. So 'dG' is the better way as there is no guessing and less typing :-) Very good video by the way.
@IPvZero
@IPvZero 4 жыл бұрын
Haha great tip, Phil! Love it! That's the thing with Vim there's an endless supply of new things to learn :) -John
@Mat-mn7hf
@Mat-mn7hf 4 жыл бұрын
I liked it!
@IPvZero
@IPvZero 4 жыл бұрын
Thanks, Matias!
@johnmoff9324
@johnmoff9324 3 жыл бұрын
Hi Coming from desktop editors Sublime and Atom and nano on terminal... I'm planning to check out vim, mind sharing your vim config file? I would like to start from there ;)
@IPvZero
@IPvZero 3 жыл бұрын
Hey Basondole. I chop and change my Vim file quite a lot. The only things that's always consistent is having a visual bell and relative number is always on haha. Definitely check out Vim, though. It's a great editor :)
@enderst81
@enderst81 3 жыл бұрын
No need to delete from the cursor to end of file by using d500j, use dG
@enderst81
@enderst81 3 жыл бұрын
I should have read the comments :)
@johnmoff9324
@johnmoff9324 3 жыл бұрын
Hi You defined the function as def baseconfig(ipvzero): ipvzero.run(kwargs) more stuff Then you use it as results = nr.run(task = baseconfig) This bit is a tad confusing to me, I'm more accustomed to seeing the argument being passed to the function in a manner; result = function(args) where the function will also have a return statement. With this line results = nr.run(task = baseconfig) What is the argument that is being passed to baseconfig as ipvzero? Was hoping for something similar to baseconfig(nr) where nr is the argument being passed to the baseconfig function. What is happening there?
@IPvZero
@IPvZero 3 жыл бұрын
This script was an old script I used to demo basic Nornir functionality. When creating a custom function it'll take argument typically called "task" - but just to highlight that there's nothing inherently special about the name task I changed it to ipvzero. You then take that object, in this case called "ipvzero" and use the run method. Nornir's concept is tasks is that they're basically functions that act per host. So when im saying ipvzero.run it's basically - run this for each host in the inventory. At the very end I use the nr object to nr.run the name of the custom function for all devices in parallel - in this case nr.run(task=baseconfig). Hope this helps! Nornir's documentation might help here: nornir.readthedocs.io/en/3.0.0/tutorial/tasks.html -John
@johnmoff9324
@johnmoff9324 3 жыл бұрын
@@IPvZero I'm confused by the method of passing the object to the function. I'll go thru the documentation perhaps it'll help.
@johnmoff9324
@johnmoff9324 3 жыл бұрын
Been trying to use the "ciw" command but everytime I hit the "i" in "ciw" it takes me to INSERT mode. How do you deal with that?
@adriansrfr
@adriansrfr Жыл бұрын
Sounds like an error in your vimrc. Do you have comments on the same lines as your mappings?
Network Automation: What is Atomicity?
6:03
IPvZero
Рет қаралды 1,4 М.
Network Automation: Desired State!
13:08
IPvZero
Рет қаралды 1,3 М.
Кәсіпқой бокс | Жәнібек Әлімханұлы - Андрей Михайлович
48:57
How do Cats Eat Watermelon? 🍉
00:21
One More
Рет қаралды 12 МЛН
This mother's baby is too unreliable.
00:13
FUNNY XIAOTING 666
Рет қаралды 29 МЛН
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 69 М.
This is How I Scrape 99% of Sites
18:27
John Watson Rooney
Рет қаралды 109 М.
Become a bash scripting pro - full course
36:00
CODE IS EVERYTHING
Рет қаралды 59 М.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
thoughtbot
Рет қаралды 898 М.
Scrapli CFG - Network Automation
21:05
IPvZero
Рет қаралды 3 М.
Vim in 100 Seconds
11:53
Fireship
Рет қаралды 1,1 МЛН
KEY CONCEPTS: eBGP vs iBGP!
18:49
IPvZero
Рет қаралды 3,4 М.
Pygame in 90 Minutes - For Beginners
1:35:22
Tech With Tim
Рет қаралды 1,1 МЛН
Postman Beginner's Course - API Testing
2:09:38
freeCodeCamp.org
Рет қаралды 2,4 МЛН