dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Make swap-quote-keys better

Open Julian opened this issue 4 years ago • 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.

Julian avatar Feb 21 '20 03:02 Julian

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

Julian avatar Mar 29 '20 17:03 Julian