Skip site navigation (1) Skip section navigation (2)

Re: psql \e and syntax highlighting in vim

From: Ireneusz Pluta <ipluta(at)wp(dot)pl>
To: Ireneusz Pluta <ipluta(at)wp(dot)pl>
Cc: damien clochard <damien(at)dalibo(dot)info>, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: psql \e and syntax highlighting in vim
Date: 2010-05-18 13:58:10
Message-ID: 4BF29CF2.20606@wp.pl (view raw or flat)
Thread:
Lists: pgsql-novice
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Ireneusz Pluta pisze:
<blockquote cite="mid:4BF298D0(dot)4000205(at)wp(dot)pl" type="cite">
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
Or invoked with its -c"set
syntax=sql" command line switch. So, the whole question is how to have
psql to tell vim which particular syntax to use, in one of these ways.<br>
  <br>
</blockquote>
OK, after real RTFM of man psql in this area:<br>
<br>
              Tip: psql searches the environment variables 
PSQL_EDITOR,  EDI-<br>
              TOR,  and VISUAL (in that order) for an editor to use. If
all of<br>
              them are unset, vi is used on Unix systems, notepad.exe
on  Win-<br>
              dows systems.<br>
<br>
I found the solution by setting the PSQL_EDITOR to 'vim -c"set
syntax=sql"'.<br>
It works now the way I want.<br>
<br>
Thanks<br>
<br>
</body>
</html>


Attachment: unknown_filename
Description: text/html (1.1 KB)

In response to

Responses

pgsql-novice by date

Next:From: Leif Biberg KristensenDate: 2010-05-18 14:07:21
Subject: Re: psql \e and syntax highlighting in vim
Previous:From: Ireneusz PlutaDate: 2010-05-18 13:40:32
Subject: Re: psql \e and syntax highlighting in vim

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group