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

Re: end-of-line not working as advertised?



On Aug 21, 10:14pm, Robin Lee Powell wrote:
}
} That is *SUPER* helpful!  Thank you so much.

This is actually a better way, I think:

vi-next-end-of-line() {
  # In vicmd mode, CURSOR can never be at EOL, and in fact can't
  # be closer than 2 positions to the left of EOL, because the
  # on-screen visible cursor is always one place to the right of
  # the value of CURSOR and never "over" the newline itself.
  if [[ $KEYMAP = vicmd ]]; then
    (( CURSOR++ ))
  fi
  if [[ $BUFFER[CURSOR+1] = $'\n' ]]; then
    NUMERIC=2
  fi
  zle vi-end-of-line	
}



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