Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Prevent new line when using edit-command-line
- X-seq: zsh-users 27332
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
- Cc: Muhmud Ahmad <muhmud.ahmad@xxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Prevent new line when using edit-command-line
- Date: Mon, 8 Nov 2021 15:05:09 -0800
- Archived-at: <https://zsh.org/users/27332>
- In-reply-to: <CAP+y1xCLSinmA=LS1wgAYsbnaRtdZO+OeSBHFFXYq2RVN7spbA@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CALbcwM=bfwL3MyHQL8ZZQVd8z-fw-gidg5x9fJN69=SLuz1mkQ@mail.gmail.com> <CAH+w=7bmezz8_Y+yR=hc+7nZWyL-fYCiWGiHbbak7Jpk-TGu5Q@mail.gmail.com> <CALbcwMnMWoyOeL2y83GHUBY8LgUQNvLc_14TYsB4wmr8LqUpmA@mail.gmail.com> <CALbcwMnvgg94-dj8T7Vzvx9oG_qjBCdG6=RLoP4RBWLmN7HM_g@mail.gmail.com> <CAH+w=7bCMn044em805e5j9mqC4nExjrsnpe9XJOdnkEkC75eiQ@mail.gmail.com> <CALbcwMmDh0PSPDKUwapGvpvL2=3htQgu+m05z7iPHzFNztCcAA@mail.gmail.com> <CAP+y1xCLSinmA=LS1wgAYsbnaRtdZO+OeSBHFFXYq2RVN7spbA@mail.gmail.com>
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