Sample Header Ad - 728x90

Move to the previous line of a multi-line command

6 votes
5 answers
13642 views
When editing multi-line commands, with escaped newlines, I cannot move up lines. For example, suppose I enter echo \ one one line, then I press Enter, and then I want to edit the echo \ part of the command. Pressing Up doesn't move back to the first command line. This works for long commands which wrap, but not with escaped newlines: _physical_up_line() { zle backward-char -n $COLUMNS } _physical_down_line() { zle forward-char -n $COLUMNS } zle -N physical-up-line _physical_up_line zle -N physical-down-line _physical_down_line bindkey -M vicmd "R" physical-up-line bindkey -M vicmd "N" physical-down-line
Asked by Leandros (722 rep)
Jan 30, 2016, 09:39 PM
Last activity: Mar 24, 2023, 01:31 AM