vim-sql-suggest


Ⅰ. 插件描述

Auto complete suggestions for your table and column names

Ⅱ. 基本信息

创建日期:  2014-09-23
使用用户:  1
Github星:  8
插件作者:  Jarrod

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'jarrodctaylor/vim-sql-suggest'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'jarrodctaylor/vim-sql-suggest'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'jarrodctaylor/vim-sql-suggest'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/jarrodctaylor/vim-sql-suggest

Ⅳ. 文档说明

# vim-sql-suggest

Use the omnicomplete popup menu to explore and complete SQL table and column

  1. The plugin currently supports mysql and postgres databases.

The Plugin In Action

sql-suggest

Usage

The plugin provides one function to call for completing tables and columns and
a convenience function for easily switching the database that suggestions are
provided for.

Mapping The Functions

You will need to map the complete function in insert mode. Here is an example.
<Leader>sc will complete for columns and <Leader>st will complete for
tables.

inoremap <Leader>sc <C-R>=SQLComplete("column")<CR>
inoremap <Leader>st <C-R>=SQLComplete("table")<CR>

Default Database

You can set a default database by setting the variable suggest_db in your .vimrc like so:

let g:suggest_db = "psql -U Jrock example_table"

You can also use the command UpdateSuggestDB to easily set the database that
the plugin will look in for completions.

Installation

Use your plugin manager of choice.

  • Pathogen

    • git clone https://github.com/JarrodCTaylor/vim-sql-suggest ~/.vim/bundle/vim-sql-suggest
  • Vundle

    • Add Bundle 'JarrodCTaylor/vim-sql-suggest' to .vimrc
    • Run :BundleInstall
  • NeoBundle

    • Add NeoBundle 'JarrodCTaylor/vim-sql-suggest' to .vimrc
    • Run :NeoBundleInstall
  • vim-plug

    • Add Plug 'JarrodCTaylor/vim-sql-suggest' to .vimrc
    • Run :PlugInstall

添加新评论