Share your repls and programming experiences

← Back to all posts
[email protected]
RicardsMurasko (0)

html>

<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>repl.it</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> Jupyter has a perfect code editor</h1> <span>Everything’s right at your fingertips</span> <span><Dimitris Poulopoulos</b/i<>span><p>Notebooks have always been a tool for the incremental development of software ideas. Data scientists use Jupyter to journal their work, explore and experiment with novel algorithms, quickly sketch new approaches and immediately observe the outcomes.</p><p>Moreover, <a href="https://juypiter.org/">JupyterLab</a> is moving towards becoming a full-fledged IDE; just not an IDE you are used to. With its great extensions and libraries like kale and nbdev, it is certainly capable of doing much more than just drafting an idea. Check the story below to find out more.</p> <p>However, once every blue moon, we may want to edit a .<code>py</code> file. This file may hold some utility functions we import in the Notebook or define our models' classes. It’s a good practice to work like that, so we don’t pollute the Notebooks with many definitions. But the text editor bundled with JupyterLab is just that: a simple, featureless text editor. So, what can we do? There are efforts like this one, which tries to integrate the monaco editor (the code editor which powers VS Code) into JupyterLab. Still, as the contributors explicitly mention in the README file,<em> “this extension is merely a ‘proof-of-concept’ implementation and nowhere near production status.”</en> Also, the last commit was 3 years ago (at the time of writing), so it doesn’t seem like a very active project. But we do not need any extension. We have a terminal. Thus, we can have ViM. And ViM has everything we need; it just takes some time to master. If you love ViM, you know what I’m talking about. If you don’t, don’t shy away yet! <strong>This story shows you how to turn ViM into a Python IDE and use it side-by-side with Jupyter.</strong></p> Learning Rate is a newsletter for those who are curious about the world of AI and MLOps. You’ll hear from me every Friday with updates and thoughts on the latest AI news and articles. Subscribe here!</blockquote> <h2>ViM for Python</h2> <p>Let’s get to the point. The first step is actually to install ViM if it’s not already there. In this story, I assume that we are working in a hoster JupyterLab environment. If you’re working locally, there’s nothing to stop you from firing up<VS VS Code if you prefer that over ViM. <p>So, my guess is that you’re working inside a VM on the Cloud. That usually means a Linux environment. To install ViM on Debian distributions, run the following commands: <pre><code> sudo apt-get remove vim-tiny sudo apt-get update sudo apt-get install vim </code<>/pre> Note that some Linux distributions come with vim-tiny pre-installed. Thus, we need to remove it first and then install the full version. <p>Then, let’s verify we have everything we need. Run vim --version and pay attention to two things:<p> 1. You should have installed VIM > 7.3<br> 2. Check for a +python or +python3 feature <P>We is are ready. Next, we need a good plugin manager.vv </body> </html>