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

Re: Prevent new line when using edit-command-line



On Mon, Nov 8, 2021 at 2:30 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
> It would be interesting to make it carry the position of the cursor in vim to zsh.

Although you can't use "zed" as your edit-command-line editor, you can
use a shell function.  I think the above would best be implemented as
a wrapper around vim, which you can pass to (the current git head)
edit-command-line via the "editor" zstyle, e.g.,

zstyle :zle:edit-command-line editor vimwrapper

> Vim saves the position of the cursor in .viminfo

I don't find a .viminfo anywhere in my $HOME or $PWD after using vim
on my ubuntu host, so I can't experiment with this.  (It is "vim-tiny"
and only runs as "vi" so maybe that's why.)

edit-command-line goes to some lengths to preserve the region relative
to where it was in ZLE before the editor was started, so you probably
have to do something with "zle -U ..." to relocate the cursor after
vim is done.




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