From: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: External psql editor
Date: Fri, 29 Apr 2022 10:18:20 -0700 (PDT)
Message-ID: <a2e1869f-6b6d-b2b3-9c5a-798aefbf1e17@appl-ecosys.com> (raw)
In-Reply-To: <CA+bJJbzhqdaK3MFaGCJDUosvnph4Z1YjN4wXGtLfyzwZzayLug@mail.gmail.com>
References: <edf1cfa4-35bf-66bf-4de2-7a3bbcb6c5e4@appl-ecosys.com>
<CA+bJJbzhqdaK3MFaGCJDUosvnph4Z1YjN4wXGtLfyzwZzayLug@mail.gmail.com>
On Fri, 29 Apr 2022, Francisco Olarte wrote:
> I do a similar thing, but normally edit queries in an editor window and
> just use selection or clipboard to paste them into the xterm where I have
> psql running. I also used joe a lot ( its key sequences where easy coming
> from wordstar(cp/m->msdos) ).
Francisco,
Joe can also be configured to use emacs chords which lets my fingers use the
same keys in both editors. :-)
> What do you mean by "here"? IIRC PSQL_EDITOR sets the editor for \e, not
> for the psql command line. For that you could try writing a binding for
> readline ( which you could also use in bash if you like them ) with the
> joe keyseqs, but I fear it's editing model is a nit different.
> I've done "PSQL_EDITOR=joe psql" to refresh my memory and it is in
> fact as I remembered.
>
> The use of joe AS EDITOR for a single command can be done with the above
> method. The use of joe keys for editting the normal psql line would
> probably require readline wizardry.
>
> I've read joe has slave shell sessions. Other thing you could try ( I've
> done it with emacs shell mode ) is use that, but I fear it only works well
> with single line queries. Or look if it has some kind of sql modes (
> interactive sql, not sql-script-syntax-highlight ).
Good information. Thanks. I'll dig into joe and see what's possible.
Regards,
Rich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: rshepard@appl-ecosys.com
Subject: Re: External psql editor
In-Reply-To: <a2e1869f-6b6d-b2b3-9c5a-798aefbf1e17@appl-ecosys.com>
References: <edf1cfa4-35bf-66bf-4de2-7a3bbcb6c5e4@appl-ecosys.com> <CA+bJJbzhqdaK3MFaGCJDUosvnph4Z1YjN4wXGtLfyzwZzayLug@mail.gmail.com> <a2e1869f-6b6d-b2b3-9c5a-798aefbf1e17@appl-ecosys.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox