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 1/3] 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 '' From f3c04248cf7bbc9ac9f17d21ee78c132021a80da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 6 Oct 2024 03:04:55 +0200 Subject: [PATCH 2/3] [chore] flake.lock: update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/1719f27dd95fd4206afb9cec9f415b539978827e' (2024-09-30) → 'github:NixOS/nixpkgs/6e6b3dd395c3b1eb9be9f2d096383a8d05add030' (2024-10-04) • Updated input 'nixvim': 'github:nix-community/nixvim/5f4a4b47597d3b9ac26c41ff4e8da28fa662f200' (2024-09-29) → 'github:nix-community/nixvim/6594472fd275f6dcf5a9fba4a83d2f7fa2cf2b8a' (2024-10-05) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/879b29ae9a0378904fbbefe0dadaed43c8905754' (2024-09-27) → 'github:numtide/treefmt-nix/4446c7a6fc0775df028c5a3f6727945ba8400e64' (2024-10-03) • Updated input 'unstable': 'github:NixOS/nixpkgs/06cf0e1da4208d3766d898b7fdab6513366d45b9' (2024-09-29) → 'github:NixOS/nixpkgs/bc947f541ae55e999ffdb4013441347d83b00feb' (2024-10-04) --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index d72406f..2de6960 100644 --- a/flake.lock +++ b/flake.lock @@ -260,11 +260,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727672256, - "narHash": "sha256-9/79hjQc9+xyH+QxeMcRsA6hDyw6Z9Eo1/oxjvwirLk=", + "lastModified": 1728067476, + "narHash": "sha256-/uJcVXuBt+VFCPQIX+4YnYrHaubJSx4HoNsJVNRgANM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1719f27dd95fd4206afb9cec9f415b539978827e", + "rev": "6e6b3dd395c3b1eb9be9f2d096383a8d05add030", "type": "github" }, "original": { @@ -292,11 +292,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1727645871, - "narHash": "sha256-Os3PAThU5XliKkKa+SHsFyV/EsCHogHcYONmpzb6500=", + "lastModified": 1728145679, + "narHash": "sha256-qd1nr2b+WUiyzJva650LBX/3hDBru0ZSVxKHSm1BE0w=", "owner": "nix-community", "repo": "nixvim", - "rev": "5f4a4b47597d3b9ac26c41ff4e8da28fa662f200", + "rev": "6594472fd275f6dcf5a9fba4a83d2f7fa2cf2b8a", "type": "github" }, "original": { @@ -373,11 +373,11 @@ ] }, "locked": { - "lastModified": 1727431250, - "narHash": "sha256-uGRlRT47ecicF9iLD1G3g43jn2e+b5KaMptb59LHnvM=", + "lastModified": 1727984844, + "narHash": "sha256-xpRqITAoD8rHlXQafYZOLvUXCF6cnZkPfoq67ThN0Hc=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "879b29ae9a0378904fbbefe0dadaed43c8905754", + "rev": "4446c7a6fc0775df028c5a3f6727945ba8400e64", "type": "github" }, "original": { @@ -388,11 +388,11 @@ }, "unstable": { "locked": { - "lastModified": 1727634051, - "narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=", + "lastModified": 1728018373, + "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9", + "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", "type": "github" }, "original": { From af1b8ccfa46ec3b2b85b13754b8350bcc869eaeb 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 3/3] 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 ''