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

Re: up-line and down-line without history



On Jun 1, 12:45am, Guido van Steen wrote:
}
} I have been trying to find out how to "just" navigate through a
} multiline buffer.
}
} Are there a similar widgets that exclusively control the navigation
} of multiline buffers, i.e. without the side-effect of potentially
} navigating the history file?

No, but this should do it:

move-line-in-buffer() {
    local hno=$HISTNO curs=$CURSOR
    zle .${WIDGET:s/in-buffer/or-history} "$@" &&
        (( HISTNO != hno && (HISTNO=hno, CURSOR=curs) ))
    return 0
}
zle -N up-line-in-buffer move-line-in-buffer
zle -N down-line-in-buffer move-line-in-buffer

-- 



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