pgsql.vim


Ⅰ. 插件描述

PostgreSQL 9.4 syntax plugin for Vim with PL/Python support

Ⅱ. 基本信息

创建日期:  2015-06-07
使用用户:  1
Github星:  2
插件作者:  spacetekk

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'spacetekk/pgsql-vim-own-character'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'spacetekk/pgsql-vim-own-character'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'spacetekk/pgsql-vim-own-character'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/spacetekk/pgsql.vim

Ⅳ. 文档说明

# Vim PostgreSQL 9.4 syntax plugin with PL/Python support

Supports PostgreSQL version 9.4, highlights most builtin functions.
Keywords according to:
SQL Key Words.

Installation

Usage

Highlights .pgsql files out of the box.
You can add pgsql dictionary to vim completion, with:

set dictionary+=~/.vim/bundle/pgsql.vim/dic/pgsql

PL/Pythonu Support

Use special markers while decalraing plpythonu functions or do
statements, etc... Example:

create or replace function plpythonu_version() returns text language plpythonu as $python$
    res = plpy.execute('select * from version()')
    return res[0]['version']
$python$;

Bonus

Some usefull snippts

添加新评论