Ⅰ. 插件描述
Execution of postgresql commands from vim bufferⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ivalkeen/vim-postgres'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ivalkeen/vim-postgres'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ivalkeen/vim-postgres'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ivalkeen/vim-postgres
Ⅳ. 文档说明
# DEPRECATED IN FAVOR OF vim-simpledb
postgres-vim
=
Vim plugin to execute postgresql commands from VIM buffer
Installation (Pathogen)
-
If you use git submodules, run this command from your .vim folder:
git submodule add https://github.com/ivalkeen/vim-postgres bundle/postgres
Otherwise, , run this command from your .vim folder:
git clone https://github.com/ivalkeen/vim-postgres bundle/postgres
Usage
-
Default key mapping for execution: <enter>.
- Create new file with .sql extension (without extensions, mapping would not work)
Create first line with commented parameters for psql:
`-- -h localhost -U postgres -d my_database`
Note: if you don't want to enter password each time, you should create .pgpass file
- Add sql statements to your file
- Hit enter, to execute all not commented queries
TODO
-
- Rewrite code to match vim script conventions
- Intellisence