How do I use vi keys in ipython under *nix?

前端 未结 6 1331
闹比i
闹比i 2020-12-04 07:48

Currently in Bash I use set -o vi to enable vi mode in my bash prompt.

How do I get this going in ipython?

Note: If an answer applies t

6条回答
  •  忘掉有多难
    2020-12-04 08:02

    You can also interactively switch between Vi-mode and Emacs mode. According to the the readline docs to switch between them you are supposed to be able to use the M-C-j key combination but that only seems to allow me to switch to vi-mode - on my Mac (where ESC is used as the 'Meta' key) it is: ESC+CTRL+j. To switch back to Emacs mode one can use C-e but that didn't appear to work for me - I had to instead do M-C-e - on my Mac it is: ESC+CTRL+e.

    FYI my ~/.inputrc is set up as follows:

    set meta-flag on
    set input-meta on
    set convert-meta off
    set output-meta on
    

提交回复
热议问题