pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

`\ns` saving query on enter in multiline Vim mode rather than inserting a newline

Open owst opened this issue 6 years ago • 0 comments

Description

\ns with multiline and Vim input mode saves the query when pressing Enter in Insert mode, when it should insert a newline instead

Usually when using multiline Vim input mode (in Insert mode signified by (I) in the footer) pressing the Enter key inserts a newline (when in Normal mode - (N), Enter will submit/run the query).

For example (in Vim multiline mode):

\sn whatever SELECT 1 <ENTER>

will save the query immediately - however, a multiline query can be saved by inserting a newline with the o command (begin new line below cursor) in Normal mode:

\sn whatever SELECT 1<ESC-o>
UNION <ESC-o>
SELECT 2

However this is a bit clunky and unintuitive.

Your environment

  • [x] Please provide your OS and version information. Ubuntu Xenial x86_64
  • [x] Please provide your CLI version. Version: 2.1.1
  • [x] What is the output of pip freeze command.
backports.csv==1.0.7
cli-helpers==1.2.1
Click==7.0
configobj==5.0.6
humanize==0.5.1
pgcli==2.1.1
pgspecial==1.11.7
prompt-toolkit==2.0.9
psycopg2==2.8.3
Pygments==2.4.2
setproctitle==1.1.10
six==1.12.0
sqlparse==0.3.0
tabulate==0.8.5
terminaltables==3.1.0
wcwidth==0.1.7

owst avatar Oct 01 '19 08:10 owst