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

edit-command-line, vim, and pasting



I've just set up my Zsh to allow me to use the `edit-command-line` widget:

    autoload -z edit-command-line && zle -N edit-command-line
    bindkey -M vicmd v edit-command-line

For some reason I can't puzzle out, though, `vim` *when invoked via
`edit-command-line`* goes haywire when I try to *paste* something,
even with `:set paste` enabled.

When I attempt to paste even a single character, my terminal-bell
signals a few times, and then *part* of whatever I attempted to paste
(usually sans the first few characters, or in some other way messed
up) is actually inserted into the document.

I can't verify precisely what character-sequence vim is receiving, but
it's something mangled; there's clearly a couple BELs in there, and
some ESCs (because I'm already in insert mode when I ⌘V, and
normal-mode commands get run; sometimes the contents of a vim buffer
are inserted at the beginning of the *actual* paste, for instance.)

It's not anything in my Vim configuration, because it occurs in the
same way even if I set `VISUAL="vim -u ''"`, preventing Vim from
loading any configuration at all. Strangely enough, however, while it
does continue to occur if I invoke a new `zsh` without configuration
(`zsh -f`), it *does not* if I indirect that sub-invocation via env …
even when manually keeping all of the environment: `env -i "$(env)"
zsh -f (what the hell does that imply?)

This doesn't occur, ever, outside Zsh; or, specifically, outside of
the `edit-command-line` mode. Does anybody have any ideas what could
be causing this?


⁓ ELLIOTTCABLE — fly safe.
  http://ell.io/tt



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