(Insert TipProposed template + minor manual clean)
Line 3:
Line 3:
|id=446
|id=446
|previous=445
|previous=445
−
|next=448
+
|next=449
|created=March 23, 2003
|created=March 23, 2003
|complexity=basic
|complexity=basic
Line 12:
Line 12:
|category2=
|category2=
}}
}}
−
Here is a simple and usefull mapping for anyone who can't stand developing queries on the psql prompt or messing around with the single \e psql edit buffer.
+
Here is a simple and useful mapping for anyone who can't stand developing queries on the psql prompt or messing around with the single \e psql edit buffer.
−
+
<pre>
−
map <F9> :!psql -d yourdb < % <BAR> less
+
map <F9> :!psql -d yourdb < % <BAR> less
+
</pre>
==Comments==
==Comments==
Line 21:
Line 21:
----
----
One other way of using vim with the \e command in psql is to set the PSQL_EDITOR environment variable. On a redhat system you'd do the following:
One other way of using vim with the \e command in psql is to set the PSQL_EDITOR environment variable. On a redhat system you'd do the following:
−
+
<pre>
−
export PSQL_EDITOR=vim
+
export PSQL_EDITOR=vim
+
</pre>
----
----
By default the buffer does not use the .sql extension. If you want syntax highlighting use:
By default the buffer does not use the .sql extension. If you want syntax highlighting use:
−
export PSQL_EDITOR='vim +"set syntax=sql" '
+
<pre>
+
export PSQL_EDITOR='vim +"set syntax=sql" '
+
</pre>
Latest revision as of 03:49, January 6, 2010
Please review this tip:
This tip was imported from vim.org and needs general review.
created March 23, 2003 · complexity basic · author Shawn Deleurme · version 5.7
Here is a simple and useful mapping for anyone who can't stand developing queries on the psql prompt or messing around with the single \e psql edit buffer.