Обсуждение: Updated .vim file
Does anyone have a .vim file that takes dollar quoting into account? I've tried the one mentioned at http://archives.postgresql.org/pgsql-general/2006-04/msg01266.php , but it doesn't appear to understand dollar quotes. -- Decibel!, aka Jim C. Nasby, Database Architect decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828
Вложения
On Tue, Oct 30, 2007 at 01:58:29PM -0500, Decibel! wrote: > Does anyone have a .vim file that takes dollar quoting into account? > I've tried the one mentioned at > http://archives.postgresql.org/pgsql-general/2006-04/msg01266.php , but > it doesn't appear to understand dollar quotes. The magic appears to be something like: :syn match pgsqlMyMatch /\$\$.\{.}\$\$/ The real regex would look a lot hairier for arbitrary legal dollar quoting constructs, but if you standardize on something like what's below, it should be easier. Cheers, David. CREATE [OR REPLACE] FUNCTION foo( input, params, here, [OUT put_params_here, ...] ) RETURNS [SETOF] SOMETYPE [IMMUTABLE] [STRICT] LANGUAGE plbar AS $[STUFF]$ ... $[STUFF]$; -- David Fetter <david@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate
2007/10/30, Decibel! <decibel@decibel.org>: > Does anyone have a .vim file that takes dollar quoting into account? > I've tried the one mentioned at > http://archives.postgresql.org/pgsql-general/2006-04/msg01266.php , but > it doesn't appear to understand dollar quotes. dollar quoting is mostly used for function bodies. would you like to have them all in StringConstantColor? :) I like it more as it is now in Vim... -- Filip Rembiałkowski
On Oct 31, 2007, at 9:33 AM, Filip Rembiałkowski wrote: > 2007/10/30, Decibel! <decibel@decibel.org>: >> Does anyone have a .vim file that takes dollar quoting into account? >> I've tried the one mentioned at >> http://archives.postgresql.org/pgsql-general/2006-04/ >> msg01266.php , but >> it doesn't appear to understand dollar quotes. > > dollar quoting is mostly used for function bodies. > would you like to have them all in StringConstantColor? :) > I like it more as it is now in Vim... Ugh. Yeah, good point. What I actually want is dollar quoting except for functions. Just catching '$$' would suffice for most of it... -- Decibel!, aka Jim C. Nasby, Database Architect decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828