← Back to context

Comment by dr_kiszonka

5 years ago

nbterm, euphorie, and even Jupyter don't seem to support shortcuts for duplicating line and moving it up/down. Why is it the case? I can't be the only person using these shortcuts :-)

(Edit: VS Code, Spyder, and PyCharm do support them, but they have their own quirks.)

You could try emacs + org-mode + jupyter https://github.com/nnicandro/emacs-jupyter#org-mode-source-b...

It supports moving the current line/region up/down (e.g., using <M-up> in Python mode that is activated for editing jupyter-python cells on <C-c '>).

  • Thanks for the link. Do you know if it supports interactive Plotły plots?

    I have tried emacs a couple of times over the last 20 years (spacemacs most recently) and it always made me feel stupid. I love the idea and flexibility, and it just seems so cool, but setting up the environment and config were pretty overwhelming to me.

    • > Do you know if it supports interactive Plotły plots?

      I haven't tried it myself but perhaps it might work via widgets https://github.com/nnicandro/emacs-jupyter#building-the-widg... (my guess that might be the overwhelming part)

      If all you need is TUI for Jupyter, then a minimal .emacs conf. from the link would do:

        ; M-x package-install RET jupyter RET
        (org-babel-do-load-languages
         'org-babel-load-languages
         '((emacs-lisp . t)
           (julia . t)
           (python . t)
           (jupyter . t)))

    • Static images are well supported, but I haven't heard of anything about interactive plots. Of course, it's possible in principle, but someone would need to code it.

Currently for edit mode, euporie uses the default emacs-style key-bindings from prompt_toolkit. So duplicating a line is as simple as Ctrl-a, Ctrl-k, Ctrl-y, Return, Ctrl-y !

I think I might add a simpler shortcut.

  • Hahaha I love this comment :) I like VS Code's shortcuts, i.e.:

    - Shift + Up/Down to a move line up or down

    - Shift + Alt + Up/Down to a copy line up or down