Codeium: Free Copilot Alternative

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi I'm David your develop on duty and in this video we're going to look at the free alternative to github's co-pilot codium which is now also available for Bim and neovim first let's try it out let's just say I want to create a JavaScript program to read a file and print all the lines of it the file must be provided by command line arguments let's put it all in the main function and also call it get file from command line arguments and you can see I already get the file I can accept it and now I want to read the content so it uses read file sync I don't want to do this so I write await and well let's see if that works so let's just run it and you can see FS is not defined so let's require it and you can see I get nice code completion let's also create the file blur this is the first line and this is the second line now let's see if this works and you can see it doesn't because this is the version where you need to provide a callback which is not provided so let's use the promises variant and you can see also here I get a nice suggestion and this time it actually works and now I can split it by lines split it by lines const lines equal to and you can see I get the nice suggestion and I can also print it console.log lines let's see if it works and you can see it works let's say I'm only interested in the first words const first words gets a line and hopefully yes you can see it splits by space and also takes the first word so let's also use it here const first words equals two lines and you can see it maps to the first word and also let's try it out and you can see it doesn't work because here an S is missing but now it works I don't like these empty strings so let's filter them out I say split it by lines and filter out empty lines and let's see yes so now it uses line trim um let's cycle through the suggestions yeah so here it filters it out let's use that and let's run it again and you can see it works but I also like this trimming suggestions so let's add a few spaces and also trim them and trim them let's see if it works and you can see yep it does try it again and still it works now we can also change our lines to some URLs let's say https food.com bar or http um google.com slash Foo let's say we are only interested in the host names so let's write a function to get the hosts const get host which takes an URL and let's see if that works let's also use it here in the code hosts and let's see map get host looks good as you could see it works reasonably well and now let's see how I actually installed it and it's pretty easy you enter Excel function codium Vim into your package manager here I use lazy and then you can run codium off and that delegates you to the website where you can register for free and the developers also say it will be free forever at least for us early adopters and then you get your API key which you can then paste into the prompt I also defined some key maps so in this case I have control semicolon for the next suggestion and comma for the previous one Ctrl X to clear it and Ctrl enter to accept it that's it for now I hope you enjoyed this video and have some fun trying out codium let me know in the comments if you find it useful thanks for watching and stay tuned
Info
Channel: DevOnDuty
Views: 32,279
Rating: undefined out of 5
Keywords:
Id: f9Bx1by1XYc
Channel Id: undefined
Length: 5min 20sec (320 seconds)
Published: Sun Jan 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.