Julian/dotfiles

Make swap-quote-keys better

Opened this issue · 1 comments

For some reason I need two ^Qs, and it doesn't work with multi-line editing.

An alternate version like:

  local c LBUFFER=$PREBUFFER$LBUFFER

  for (( c = $#LBUFFER; c > 0; c-- )); do
    if [[ $LBUFFER[c] == \' ]]; then
      LBUFFER[c]=\"
      break
    elif [[ $LBUFFER[c] == \" ]]; then
      LBUFFER[c]=\'
      break
    fi
  done

  print -rz -- $LBUFFER$RBUFFER
  zle send-break

would, but should change that so that it only uses that way if it's multiline, otherwise with single-line input, the send-break causes duplicate lines.

g x "It's a good song OK? -> g x 'It''s a good song OK?