Re: [dev] [sandy] Implement copy/paste/replace?

From: Rafa Garcia Gallego <rafael.garcia.gallego_AT_gmail.com>
Date: Tue, 15 Jul 2014 09:51:32 +0200

On Mon, Jul 14, 2014 at 6:50 PM, Charlie Kester <corky1951_AT_comcast.net> wrote:
>> I just wanted your opinion in implementing a feature inside the code
>> or calling it via sh.

Let's try to keep as many possible text operations "scripted out" as
possible. Right now this holds true for:

- Buffer C&P (xsel | tee)
- Autoindent (awk)
- Capitalize / Uppercase / Lowercase (awk / tr)
- Line joining (tr)


And it should be easy to add more. We pass a bunch of env variables to
anything we spawn and take commands on a named pipe, so even more
complex operations (e.g. search and replace with confirmation) could
be implemented as a external command.


>> Which are the advantages for calling a script?

First and foremost: simplicity. Any code we write we have to maintain.
More code is the way of vim. Let's make less code the way of sandy.

Other than that, see Charlie's mail, which has some very good points.
Text piping is the sanest interface.


> Your question is an interesting one. It has me looking at the internal
> commands I do still use in vim and wondering how they might be implemented
> as external programs.

Good! Please share your conclusions when you are done.


> One thing an editor could do to improve on vi(m)'s "!" command, btw, is to
> pass arbitrary ranges of text to the external command, instead of
> a range of *lines*.

Sandy already does this. Let's try to add a "!" command.
Received on Tue Jul 15 2014 - 09:51:32 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 15 2014 - 10:00:11 CEST