DataNvim is a custom Neovim distribution prepared for Data Science and to easily run code and interact with Jupyter Notebooks without ever leaving your terminal. It also provides a well structured config that makes it an easy starting point to extend it as you want.
- GCC
- Kitty 0.28+
- Neovim 0.9.4+
- Python 3.10+
- Ripgrep 11.0+
- Quarto
- Npm 10.8.1+
- ImageMagick
- Lua 5.1
- Required python packages:
- Carefully designed configuration file structure for easy extension and modification
- Beautiful colorscheme from catppuccin
- Powerful file explorer with nvim-tree
- Fuzzy search and preview files, words and gitfiles thanks to telescope
- Preconfigured highlighting and Lsp Autocompletion for Python thanks to treesitter and nvim-lsp-config
- Extensible formatting, diagnostics, code actions and completion with none-ls and ruff
- Complete Jupyter Notebook interaction set up thanks to molten.nvim, quarto, and jupytext
- Simple but beautiful status bar thanks to lualine.nvim
- Easy buffer navigation with bufferline.nvim
- Pull DataNvim's image from
ghcr.io/noopeeks/data-nvim:latest
docker run -it ghcr.io/noopeeks/data-nvim:latest /bin/bash
# Once inside prompt, run nvim
nvim
- Try it out, there is a demo .ipynb file in the home directory!
Warning
DataNvim will only render images if the terminal it's used on is Kitty!
- Install all the listed dependencies
- Install Kitty
- Install luarocks, Lua language's package manager.
- Install the
magick
rock with:luarocks --local --lua-version=5.1 install magick
- Create a virtual environment for Neovim in
~/.virtualenvs/
mkdir ~/.virtualenvs
cd ~/.virtualenvs
python -m venv neovim
- Activate the virtual environment and install the beforementioned python packages with:
source ~/.virtualenvs/neovim/bin/activate
pip install ipykernel jupytext pynvim jupyter_client cairosvg plotly kaleido pyperclip nbformat pillow
python -m ipykernel
deactivate
- Install ipykernel and jupytext in your project-scoped virtual environment
cd whatever/directory/your/project/is/in
source venv/bin/activate
pip install ipykernel jupytext
python -m ipykernel install --user --name project_name
- Backup your current Neovim configuration
mv ~/.config/nvim ~/config/nvim.bak
- Install DataNvim's configuration
git clone https://github.com/NoOPeEKS/DataNvim.git ~/.config/nvim && nvim
- Run the following commands:
:UpdateRemotePlugins
:MasonInstallAll
- Open your notebook with the virtual environment activated and load the kernel with
:MoltenInit project_name
or Space + m + i. - Start executing cells with Keybindings
Key | Mode | Action |
---|---|---|
Ctrl + h | i | Navigate left in insert mode |
Ctrl + j | i | Navigate down in insert mode |
Ctrl + k | i | Navigate up in insert mode |
Ctrl + l | i | Navigate right in insert mode |
Ctrl + s | i, v, n | Save current buffer |
Space + x | n | Close current buffer |
Tab | n | Go to next buffer |
Shift + Tab | n | Go to previous buffer |
Key | Mode | Action |
---|---|---|
Ctrl + n | n | Toggle file explorer |
Ctrl + j | n | Focus file explorer |
Key | Mode | Action |
---|---|---|
Space + g + f | n | Format current buffer |
Key | Mode | Action |
---|---|---|
Space + m + i | n | Molten Init Python Kernel |
Space + m + l | n | Molten Evaluate Current Line |
Space + m + v | v | Molten Evaluate Visual Selection |
Space + m + o | n | Molten Enter Cell Output |
Space + m + h | n | Molten Hide Output |
Key | Mode | Action |
---|---|---|
Space + f + f | n | Telescope Fuzzy Find File |
Space + f + w | n | Telescope Fuzzy Find Word |
Space + f + b | n | Telescope Fuzzy Find Buffers |
Space + f + o | n | Telescope Fuzzy Find Oldfiles |
Space + f + z | n | Telescope Fuzzy Find Current Buffer |
Space + f + h | n | Telescope Help Tags |
Key | Mode | Action |
---|---|---|
g + D | n | Go to Declaration |
g + d | n | Go to Definition |
K | n | Hover |
g + i | n | Go to Implementation |
leader + c + a | n | Code Action |
Ctrl + k | n | Signature Help |
Space + w + a | n | Add Workspace Folder |
Space + w + r | n | Remove Workspace Folder |
Space + w + l | n | List Workspace Folders |
Space + D | n | Go to Type Definition |
Space + r + n | n | Rename |
g + r | n | List References |
Space + e | n | Open Diagnostic Float |
[ + d | n | Go to Previous Diagnostic |
] + d | n | Go to Next Diagnostic |
Space + q | n | Set to Quickfix list |
DataNvim is a very straightforward Neovim distribution that aims to be a batteries-included starting point for Data Science in Neovim. Thus, its directory structure for configuration is meant to be easy to understand:
├── init.lua <- Neovim's entrypoint. You should probably not modify anything here. Just require your own files.
├── lua <- Configuration for DataNvim goes here.
│ ├── plugins.lua <- Empty table. It will contain everything inside plugins/
│ ├── vim-options.lua <- Vim options and general movement keybindings.
│ ├── plugins <- This folder contains all of your plugins. To install new ones, create a file and make it return your plugin.
│ │ └── plugin_name.lua <- Returns a table with the plugin to install and its configuration.