My Complete Atom For Python Setup Tutorial!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what's up everyone welcome back in this video I'm going to show you how to set up atom for Python so atom is a text editor that's very similar to sublime text except it's completely free and open source so you're free to go in and change anything you like to make it look and feel exactly the way you want it to so it's fairly new it's gaining a lot of popularity mainly because there's a great community of developers making packages and styles that really improve its functionality and workflow so if it sounds like something you're interested in I'm going to show you exactly how I have it set up so let's get started so first come to Adam Daioh and click this big red download button so once the download is complete just click on the installer and it'll begin setting up Adam for you you'll get this splash screen showing you that it's setting up so once it's done you'll be greeted with this welcome page so the first thing I like to do is uncheck this show welcome guide when opening Adam because I don't want to see it every time it opens there's also this telemetry consent asking you if you want to provide information to Adam so I'm gonna be nice and click yes because that's what it's all about and there's also this welcome guide which you don't really need so I'm going to close out of that too so right out of the box Adam is not going to be able to run Python code and we're gonna need to install a package to do that so the way we install packages is we go to file settings install and we search for the package so there's a lot of different options for running Python code but the package I use is called script so I'm just going to type script hit packages and it's the first one that comes up so I'm going to click install so once it's done installing we can click right on it and we can read a little bit more about it so you can see it says run script based on file name a selection of code or by line number so below it gives you a list of all the languages it supports and you'll find that python is in the list so the next table gives you a list of shortcut commands so the one where most most interested in is the script run so for Windows it's shift control B so I don't know about you but I don't like hitting shift control B I'd rather just hit control D so if you want to change that what you'll do is come to the top click on View code so in here in the scripts folder there's a keymaps and a script sison file and then you'll see right here there's a thing for script run and the shortcut so I'm gonna just change it to control B instead of shift run so now I'm gonna save that blows it and I'm going to close this window here and then I'm also gonna restart atom because sometimes you have to restart it so now that I've restarted atom I'm gonna go ahead and save my first file so I'm gonna hit ctrl s to save I'm just going to save this on my desktop and let's just do print hey it worked oops worked so now I'll save and if I hit ctrl B it worked so you can see the output right here and I don't know about you guys it's a little small for me it might be okay for you but when I'm doing these videos I like to make it a little bigger so if you want to change the output size the way you do that is you go to file settings go to your themes and then there's this thing called your stylesheet so click on that it's gonna open up a style sheet and the way you do is you'll need to add a little thing here so I don't link in the description to this site where someone asked the question already but you'll just come and copy this and you'll just paste it right here and then you you're free to choose whichever size you want I'm gonna do 26 which is good for these videos it's save and you can see already the output increased in size that's your style sheet and that script so the next package I want to install is called file icons and what it does is make these things look a little nicer based on their extension so it's called file icons so I'm going to search packages and it's this one right here so I'll click install and once this is done installing you should see these update right away so yeah you can see we've got nice little cool icons just a little bit more aesthetically pleasing so the next package I want to install is called mini-map and for those of you who have used sublime text you've probably familiar with the mini-map so I'm just gonna search mini-map click install it's the first one and I'm also gonna install the mini-map highlighted selection I will install the dependencies and I think we're good to show you how it works I'm gonna go ahead and open up an existing file that I have so you can see the mini-map is this column right here on the side and it gives you a preview of your entire project there's this little highlighted section which is showing you what is in here in this main window and you can click and drag to quickly scrub and go through any part of the file that you like there's also this docks where it will show you the dock string of the imports that you have personally I don't really like it so I'm going to close it and I also installed that mini-map highlighted so what that does is if I click on something like this here log dirt it will highlight and in the mini-map it'll show it it'll highlight it in the mini-map I'm not sure if you can see those little white boxes but what's nice is I can see where they are and then I can quickly go to where they are in the file and because it draws this box around it also it's really simple to find things that you're looking for so that's mini-map and mini-map highlighted so some people like and dislike this next one that I'm going to install but I like to have an autocomplete package so I'm just gonna come here and type auto complete Python and this is the one I want so what autocomplete does is as you're typing it's gonna pop up a window with the list of suggestions of what you're gonna type almost all the time it's suggestions are really good and they're exactly what you want so it's gonna say do you want to use the local engine or kite so I believe kite is just for Mac users so I'm just gonna select the local engine and now if I jump over to my project here so I have OS installed so if I do say oh s dot so yeah it suggests Lister you can do skander so yeah it pops up with really good suggestions on what I want so I find it useful some people don't so for people who've used pycharm before you're probably familiar with linters where it's gonna highlight errors in your code and it suggests changes for it it's another controversial one some people like it some people don't I prefer having linter to make sure I don't make mistakes so the one I'm gonna use is called flake eight so this linter flake eight this is the one I use so I'm going to go click install so install dependencies yes so now I think with this one you have to do a pip install I'm not mistaken yeah it also requires this UI so I'm gonna click yes all in all the dependencies like I said it says you have to do a pip install flake eight if you don't have flake eight you can just come here run it I already have it installed but if you don't you should it'll go and install your flake eight all the dependencies should be good so let's jump over to our example and see if we get some errors so you can see we've got trailing whitespace that we don't want let's do something like four this is one thing that I hate about the linter is it tends to make your atom crash so we're back after that crash so side note to the makers of the flake eight please make it less crashy but for the most part it works so let me show you so if I make some mistakes like for I in range it's saying that this thing should be at the top and yeah it gives you a list of all the errors here which you can kind of show here so that's the linter it's a way of highlighting all your problems they can sometimes get in the way because you are just typing and these things pop up a lot and you don't want to see them because you're gonna fix them right away but they're popping up yeah so that's the linter so one customization that I like to do with the winter is there's certain errors that I don't care about and I don't want them popping up so what you can do is you can get rid of or ignore certain errors so for example if I pop over here I have this function you can see I've been getting this error saying expected to blink lines after a class or function so say I don't want that to show up you can see that the air has a little code right here III oh five so if I come over here to the ignore errors list and type III oh five and then I jump back here wait a second and now it's gone it's gonna ignore that one and so if there's ones that pop up and bug you just add them to that list the one thing that I really don't like is after 80 spaces it tells you you need to go to the next line and doesn't want you to put characters after 80 so I always make the max line length really big so I don't get that error because I have a 4k monitor so I can see the code and 80 characters there's no problem so I just set this really high and that way I don't get that one either or I could just add it to the exception list so if you have a particular font that you like you can come over to the editor and there's this field called font family and you can go ahead and enter any font you like so the one I like is console us and you may not even notice a difference but you're free to choose whichever one you like so that's how you change the font family and another thing I like to change is the line height you can see there's this field called line height by default it's set to 1.5 if we were to say make it 1 you'll see that all these things are really smushed together which is not nice so what I like to do I like to go a little bit bigger 1.75 and you can see there's a lot more space between the lines and I don't know for me I think it's a little more readable so I go with 1.75 and you're free to choose whichever one you like another popular it selection that people choose is this scroll past the end so with it unchecked if I go to the end that's as far as I can scroll but if I want this if main part to be up here all I need to do is click on the scroll past the end and so now I can bring it all the way to the top another thing I like is this indent guide so without it for example here for these intentions if nothing is shown but if I were to click it you can see show indent guide so now there's these little lines right here that kind of guide you and show you where the intention should be so I like it if you want it you just click the show indent guide so if you're using Python then you're definitely going to want to set your tab link to 4 if you're using some other language then you're probably free to choose whatever you like but for Python you definitely want 4 unless you want to click space 4 times which I don't know who would actually do that so another change I like to make is to get rid of this vertical line over here so the purpose of it is to indicate when you should end your line and start a new one but I kind of like to let my lines go a little longer especially because the screen I have it lets me do that so what you want to do is disable this core package called wrap guide if you go to your packages scroll down you'll go to you'll go to your quarters and I think it's the last one so you'll just hit disable and now that line is gone so that's how you get rid of it so the last package I would like to install is an auto Pepe package so what this does is it'll format your file so that it's got commas with white spaces after them white space between equal signs but not when it's in function calls and to white spaces after functions but one white space after class methods stuff like that to make it standard the way it's written so the one I use is called Python auto Pep 8 so we'll just quick and install this and once it's done installing I think we need to go into it and we need to click format on save so I don't think there's any yeah there's no pip install that we need to do so for example let's put this fake def function that I had here and I'll just do ctrl save and you can see it adds the two spaces let's get rid of that space after the comma it controls save it adds the space back so it's something nice just to make sure it's consistent so one of the great things about atom is the themes so there's two types of themes UI themes and syntax themes UI themes are stuff like buttons dropdowns how this column is set up how this tree structure set up and things like that syntax themes are how words are colored and highlighted and shown in your files so right out of the box the one dark UI theme and the one dark syntax team is already really nice I think it's a great theme the colors are pretty cool so I actually leave the one dark UI theme as is and then the syntax theme that I like is called kick dark syntax so if you watch some my other videos that's the one I use it's not very popular it's only got 241 downloads but it's the one I like so the way you do you install it is you just click on it install I've already done it so you come back over to themes and then you just select it from the drop-down so this is what it looks like right out of the box and I what I do is I make a little tweak to it because I think the background is a little - a little too light I want it I want it darker so the way you can do that is if you go to the theme you just click on it and then there's this view code so we can click on that and then we get a window that pops up with all the files that define the code so what these are are less sheets so a dot L ESS is it's like a CSS sheet that does the styles so what we can do is we can edit this to make the theme look the way we want it so the way I'm going to change it is if I go to the editor less sheet at the top at the very top of it there's this atom text editor so I want to change the background color so with less you can just take the existing color and there's these cool functions called like darken or lighten so I can just put the color inside a function called darken and then I can just say how much darker I want so I'm gonna do 7% so when I save this switch over to my editor and in order for it to take effect you have to like swap the theme once so I'm going to go back to Dropkick dark and now you can see this is a lot darker so if I wanted to do other tweaks in there you can go to the languages tab and then go to the pipe on less you can play with these things to make them look however you want I'm not exactly sure so I'm not a CSS the last editor but I was able to just kind of play around until I got it so it worked the way I wanted it to so that's how you can tweak your style sheets and if you feel ambitious you can write your own and post it and see if people like it so that's all I've got for this video guys if you liked it give it a like if you've got any questions if you set up your Adam someway completely different or if you've got some other editor that you like post in the comments below I'd like to hear what you guys think if I missed a package also leave a comment and if you're new and you like the content you're seeing we'll hit that subscribe button and I'll be I'll be making a lot more videos so thanks guys see ya [Music]
Info
Channel: Mark Jay
Views: 134,803
Rating: 4.9281726 out of 5
Keywords: Atom, Atom editor, text editor, IDE, notepad++, pycharm, sublime text, python, less, css, java, ruby, github, open source, editors, packages, atom io, spyder, anaconda, vim, nano, eclipse, visual studios, jupyter, script, programming, monokai, one dark, UI themes, atom dark, dark themes, monospaced, fonts
Id: jhO827u-yl0
Channel Id: undefined
Length: 16min 54sec (1014 seconds)
Published: Thu May 25 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.