Neovim PDE for Data Science (Part 2)

Configure a PDE for data science — Python, R, and Julia.

alpha2phi

--

Neovim PDE for Data Science (Part 2)

We will continue our journey to configure a PDE for data science.

This article is part of the Neovim PDE series.

The Neovim configuration files are available in this repository.

Getting Started

We configured a development environment to edit Jupyter Notebook in the previous article. The environment can also be used to edit regular Python files. With this configuration, we can have a familiar experience using Jupyter, from within Neovim.

Neovim PDE for Data Science

Context Menu using hydra.nvim

To have a better user experience, we will configure a context menu using hydra.nvim.

In the lua/base/editor.lua file, we configure the plugin.

  {
"anuvyklack/hydra.nvim",
event = { "VeryLazy" },
opts = {
specs = {},
},
config = function(_, opts)
local hydra = require "hydra"
for s, _ in pairs(opts.specs) do
hydra(opts.specs[s]())
end
end,
},

In the lua/pde/jupyter.lua file, we configure the menu.

With this configuration, we now have a context menu that provides quick access to manipulate the REPL.

We can trigger the menu using <A-n>, as shown below.

REPL Menu

Let’s continue to configure the environment with other programming languages.

R

We configure R in the lua/pde/r.lua file.

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.