It’s Sublime Text 3! In this article, I’ll show you:Used as the core of several text editors. But I’ve realized that I’ve never introduced my favorite script editor. Or just suck it up and use vi or nano:-) If you're going to be doing a lot of this type of thing TextEdit is probably the least desirable editor to use anyhow.I’ve written about the importance of scripting in data science. You should use a different editor that can have its binary run properly from the command line like SublimeText (sudo subl /path/to/file) or TextMate (sudo mate /path/to/file).GUI text editors such as gedit (for Gnome), Kwrite, and more. There are two types of text editors in Linux, which are given below: Command-line text editors such as Vi, nano, pico, and more. A Linux system supports multiple text editors. Linux text editors can be used for editing text files, writing codes, updating user instruction files, and more. A utility that parses and transforms text, using a simple, compact programming language.12) Coda: Coda is a text editor for Mac OS.Note: After writing and re-reading this article, I’ve realized that I speak very highly of Sublime Text 3… So just in case, let me add here: I praise it because I love it. Official URL: Light table. It provides many features like inline evaluation, watches, malleable, and plugin manager. It is a lightweight open source application. 11) Light Table: It can be used on Windows, Linux, and Mac.
You can use them from the command line and mcedit even has a nice, visual, point-and-click type of interface — similar to Sublime Text.But while many data scientists love these old-school script editors, in my experience, they are not user-friendly enough. Vim, nano, etc.Sublime is not the one and only text editor for coding.Many data scientists use vim or nano — or my favorite: mcedit.These are all good tools for editing scripts and code. It gives you a script overview on the right sideAnd that’s just the beginning there is so much more in Sublime Text 3… Sublime Text 3 vs. It shows the number of the lines in your script It recognizes every major language that you will use as a data scientist: SQL, Python, bash, R, etc. Sublime Text colors your code according to the syntax you use Which Text Editor To Use For Bash In How To Get TheIn this article, I’ll list only a few of my favorite features that I use in my data science projects day-to-day — you know, just to whet your appetite. Sublime Text 3: a few key features that will make your coding life easier and happierThere are hour-long online courses about how to get the most out of Sublime Text 3. It’s much faster, much smoother and much more efficient than anything else you’ve used before. For instance, I’ve used mcedit for years… But once you try Sublime Text 3, there is no going back. Sql format.)Even in the most cleverly written data science script, sometimes you have to be repetitive. Here I’ve copy-pasted the SQL script I showed you before.But you can turn this into a beautifully coloured SQL script by either selecting your preferred language manually:Or by simply saving the script with the right file extension. When you type (or copy-paste) your code, Sublime won’t automatically recognize which language you use. All other occurrences will be highlighted automatically:2. Select one occurrence of the text/pattern you want to change. (“Ah, typical, the data infrastructure team changed the column names in our SQL database, again! Now I’ll have to go and fix all my scripts…”)First off, there is the usual find-and-replace-all feature, in Sublime Text, too.Just hit: CMD + ALT + F (Mac) or CTRL + H (Windows/Linux)But there is an even more visual (and flexible) solution to get the same thing done.1. And when you start to type some text, it magically shows up at every cursor.Multi-cursor can be used to change the pre-existing parts of your script, too!Let’s say that in your SQL script, you want to change the user_id keyword to email_address. By holding the CMD key on Mac — or the CTRL key on Windows/Linux — you can place multiple cursors on your screen. You can set your preferred character size, color scheme, drag speed, etc. CustomizationSublime Text 3 is 100% customizable, too. This can be especially handy for Python scripts when you work with many, many variables. It’s a desktop application, right? But don’t worry, it’s definitely possible — thanks to randy3k (and many others) who created an awesome open-source solution for this.In the original Github repository there is a brief description of how to set things up. (Again: if you want to see more, go to Youtube, there are tons of cool tutorials on this topic.) Using Sublime Text 3 on a remote serverOne of the top questions I get from my course participants is: how they can use Sublime Text 3 on a remote server.It might look impossible at first sight. It might look complicated but if you try it out, you’ll get used to it quickly… and I love the flexibility it provides.Okay, these were my favorite five key features of Sublime Text that make my coding tasks so much easier and smoother. This is how I set the default font size in my Sublime Text editor to 16 pixels.Anyways. So to fine-tune your environment settings, you have to code. You’ll use that connection — and a specific port — to send scripts back and forth between your remote server and local Sublime Text 3. You’ll open a regular ssh connection to your remote server RemoteSubl – the concept of using Sublime on a remote serverWe will use the RemoteSubl package to connect our Sublime Text 3 editor to our remote data server. If you don’t, go through this remote server for data science tutorial first. So in the rest of this article, I’ll give you a bit more in-depth, step-by-step process for how to set things up — so you can use Sublime Text3 on your remote server, too.Note: I’ll assume that you use the very same server setup that I use in all Data36 tutorials and video courses. And, as promised, I’ll dig a little deeper into a few parts. A remote data server with Python, SQL and bash.Next, we will go through the instructions of the RemoteSubl github repository. The setup processTo set things up, you will need to install a few things to your remote server and to your computer, as well.I assume here that you already have these: So here’s a more visual explanation of the concept.And by the end of this tutorial, when you set up everything properly, these four steps will happen seamlessly and automatically anyway. When you save the script in Sublime, it will send the updated version back to your remote server.I know, it sounds complicated. Game boy dmg backlightSTEP #2: Installing the RemoteSubl packageChoose: Package Control: Install Package!Here, lots and lots of available Sublime packages and extensions will be listed.Type: RemoteSubl. These don’t come with the original setup of the program but you can easily add them later by using the Package Control feature.If you have never used it before, you’ll have to install Package Control first.For that, go to Top Menu > Tools > Command Palette!You’ll get a quick notification that it has been installed.Great! Now you can add new packages to Sublime. Editing your first script with Sublime Text3 on your remote server.STEP #1: Installing Package Control to Sublime Text 3There are tons of extensions and additions for Sublime Text 3. Installing RemoteSubl to your remote server. Installing the RemoteSubl package. Now, install RemoteSubl to your remote server, too. Go back to Top Menu > Tools > Command Palette , then type “RemoteSubl”… If you see this “Preferences: RemoteSubl Settings”, the installation was successful! (You don’t have to click it.) STEP #3: Installing RemoteSubl to your remote serverOkay, everything is set on your local computer.
0 Comments
Leave a Reply. |
Details
AuthorSampson ArchivesCategories |