From 76b8c3627035ea1db7be220ee062bacf7b6ee23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 5 Oct 2024 22:37:58 +0200 Subject: [PATCH] feat(nvim): setup for ipynb dev work Setup: - molten (run python code) - otter (lsp in markdown codeblocks) - jupytext (convert .ipynb files to .md files transparently) - image (display images inside neovim (e.g. matplotlib graphs)) --- nvim/plugins.nix | 20 ++++++++++++++++++++ nvim/standalone.nix | 1 + 2 files changed, 21 insertions(+) diff --git a/nvim/plugins.nix b/nvim/plugins.nix index 9db807f..f36360b 100644 --- a/nvim/plugins.nix +++ b/nvim/plugins.nix @@ -160,6 +160,15 @@ in }; }; gitsigns.enable = true; + image.enable = true; + jupytext = { + enable = true; + settings.custom_language_formatting.python = { + extension = "md"; + style = "markdown"; + force_ft = "markdown"; + }; + }; lint = { enable = true; lintersByFt = { @@ -214,6 +223,15 @@ in enable = true; settings.update_events = "TextChanged,TextChangedI"; }; + molten = { + enable = true; + settings = { + image_provider = "image.nvim"; + virt_text_output = true; + molten_auto_open_output = false; + molten_virt_lines_off_by_1 = true; + }; + }; noice = { enable = true; lsp.override = { @@ -245,6 +263,7 @@ in mode = "virtualtext"; }; }; + otter.enable = true; rustaceanvim = { enable = true; # Install through rustup @@ -260,6 +279,7 @@ in treesitter = { enable = true; settings = { + highlight.enable = true; indent.enable = true; incremental_election.enable = true; }; diff --git a/nvim/standalone.nix b/nvim/standalone.nix index 155d91b..fe2c191 100644 --- a/nvim/standalone.nix +++ b/nvim/standalone.nix @@ -62,6 +62,7 @@ pkgs.unstable.typos pkgs.unstable.yamlfmt ]; + extraPython3Packages = p: [ p.jupytext ]; extraConfigLuaPre = # lua ''