zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Pier Paolo Grassi <pierpaolog@gmail.com>
Cc: Muhmud Ahmad <muhmud.ahmad@googlemail.com>,
	Zsh Users <zsh-users@zsh.org>
Subject: Re: Prevent new line when using edit-command-line
Date: Mon, 8 Nov 2021 15:05:09 -0800	[thread overview]
Message-ID: <CAH+w=7b1meaZJF6LKCqC0grofxOZGGuGfT4Guk5-aaSWGfs_qQ@mail.gmail.com> (raw)
In-Reply-To: <CAP+y1xCLSinmA=LS1wgAYsbnaRtdZO+OeSBHFFXYq2RVN7spbA@mail.gmail.com>

On Mon, Nov 8, 2021 at 2:30 PM Pier Paolo Grassi <pierpaolog@gmail.com> 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.


      reply	other threads:[~2021-11-08 23:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08  7:17 Muhmud Ahmad
2021-11-08 16:46 ` Bart Schaefer
2021-11-08 16:53   ` Muhmud Ahmad
2021-11-08 16:54     ` Muhmud Ahmad
2021-11-08 17:56       ` Bart Schaefer
2021-11-08 19:14         ` Muhmud Ahmad
2021-11-08 22:29           ` Pier Paolo Grassi
2021-11-08 23:05             ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7b1meaZJF6LKCqC0grofxOZGGuGfT4Guk5-aaSWGfs_qQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=muhmud.ahmad@googlemail.com \
    --cc=pierpaolog@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).