Re: psql command line editor

From: Bob Gobeille <bob(dot)gobeille(at)hp(dot)com>
To: Steve Atkins <steve(at)blighty(dot)com>
Cc: pgsql-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql command line editor
Date: 2009-08-17 19:39:50
Message-ID: AC8E0096-7EA7-471A-A28B-D185B42CE2E3@hp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Aug 17, 2009, at 1:27 PM, Steve Atkins wrote:

>
> On Aug 17, 2009, at 12:15 PM, Bob Gobeille wrote:
>
>>
>> On Aug 17, 2009, at 12:46 PM, Alvaro Herrera wrote:
>>
>>> Bob Gobeille wrote:
>>>> I use PSQL to set my editor to vi. This works as expected in psql,
>>>> \e brings up vi and I edit away.
>>>>
>>>> Is there any way to set my psql command line editor to also use vi
>>>> (just like I do with "set -o vi" in bash)?
>>>> I can't find this in the docs.
>>>
>>> I have in my .inputrc this line:
>>>
>>> set editing-move vi
>>>
>>> and it works like a charm.
>>
>> I tried this and can't get it to work.
>> 1) I tried putting that in my .bashrc script and sourcing the file
>> (and also logging in again)
>> 2) I did the set on the command line and then started psql
>
> It's a readline setting, not an environment variable. Try putting it
> in ~/.inputrc.
>
> Though it looks like you're on a Mac, and that's likely to be using
> editline
> rather than readline, in which case putting "bind -v" in ~/.editrc
> would be
> what you need. That'll start you in input mode, so 'esc' should switch
> you
> to navigation mode.

My workstation is a mac laptop, so that's where my email client is.
I'm running psql on a debian lenny server.
I have the set command in my ~/.inputrc. I even logged out and back
in. But in psql I type in a command, hit escape then 0 to go to the
beginning of the line - no go. I do see things like ^r doing a
reverse search but basic cursor movement commands like 'w', '0', '$',
etc do not work.

Bob

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bob Gobeille 2009-08-17 19:43:39 Re: psql command line editor
Previous Message kbarnard@kevinbarnard.net 2009-08-17 19:38:19 Re: psql command line editor