Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: vi-open-line-* in Emacs mode



meino.cramer@xxxxxx writes:

>  I often edit """scripts""" on the commandline, like
>  short loops etc. 
>  Often too I forget to insert a specific line and
>  have to re-edit my """script""". In the real world
>  I am a Vi(m) user, but for command-line-editing
>  I prefer Emacs-mode.
>  In this mode I miss a keysequence to add/insert/open
>  a new line.

ALT--ENTER opens a new line in emacs mode.

>  I found vi-open-line-above and -below, but there seem
>  no Emacs equivalent available .... (?)
>  I tried to bind those functions:
> 
>  bindkey "\M-o" vi-open-line-below   # vi like open line below cursor position
>  bindkey "\M-O" vi-open-line-above   # vi like open line above cursor position
> 
>  but this does not work.

Try:

bindkey "^[o" vi-open-line-below
bindkey "^[O" vi-open-line-above

Meta keys are seldom used anymore since they don't work with UTF-8.
Most terminal emulators send 'ESC-<char>' rather than 'meta-<char>'
these days when you press a ALT-key.

Phil.



Messages sorted by: Reverse Date, Date, Thread, Author