diff --git a/home-manager/shared/shell/helix/default.nix b/home-manager/shared/shell/helix/default.nix index 76304ef..444f72b 100644 --- a/home-manager/shared/shell/helix/default.nix +++ b/home-manager/shared/shell/helix/default.nix @@ -16,6 +16,31 @@ zellij action toggle-floating-panes zellij action close-pane ''; + jupyter = + pkgs.writeText "run_jupyter_from_helix.zsh" + '' + #! ~/.nix-profile/bin/zsh + function new() { + new=true; + touch /tmp/rjh; + cat /tmp/rjh | while read line + do + if $(pwd) = line; then + new=false; + fi + done + echo new; + } + + function send_to_jupyter() { + if $(new); then + zellij run -f -n "jupyter console" jupyter console --kernel="$1" -f="/tmp/rjh-$(pwd).json" --ZMQTerminalInteractiveShell.include_other_output=True --ZMQTerminalInteractiveShell.other_output_prefix=\'\' + pwd >> /tmp/rjh + fi + zellij write 29 25 # send ctr + w + just send + } + ''; in { programs.helix = { enable = true; @@ -29,6 +54,7 @@ in { t = ":sh zellij run -f -n 'test code' -- direnv exec . just test"; g = ":sh zellij run -fc -n 'lazygit' -- lazygit"; f = ":sh zellij run --floating -n 'yazi picker' -- zsh ~/.config/helix/open_in_helix_from_yazi.zsh "; + j = ":pipe-to just jupyter"; }; editor = { line-number = "relative";