Ⅰ. 插件描述
Auto complete suggestions for your table and column namesⅡ. 基本信息
|
Ⅲ. 安装方法
使用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
- The plugin currently supports
mysqlandpostgresdatabases.
The Plugin In Action

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.
git clone https://github.com/JarrodCTaylor/vim-sql-suggest ~/.vim/bundle/vim-sql-suggest
- Add
Bundle 'JarrodCTaylor/vim-sql-suggest'to .vimrc - Run
:BundleInstall
- Add
- Add
NeoBundle 'JarrodCTaylor/vim-sql-suggest'to .vimrc - Run
:NeoBundleInstall
- Add
- Add
Plug 'JarrodCTaylor/vim-sql-suggest'to .vimrc - Run
:PlugInstall
- Add