Ⅰ. 插件描述
This project is a vim plugin that allows you to pull code from sites like Github, Stack Overflow, and Quora directly into your code, without leaving the editor.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'kasandell/code-pull'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'kasandell/code-pull'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'kasandell/code-pull'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/kasandell/code-pull
Ⅳ. 文档说明
#Code Pull
This vim plugin allows you to pull code from the web into your own code, without ever leaving the editor
Setup
This plugin is pathogen compatible. If you do not have pathogen, simply clone this project in your system's ~/.vim directory.
After installing, the plugin should load whenever vim is launched.
Usage
To use this plugin, open vim, position your cursor on the line above where you want to put the code. Then enter command mode and type
:Pull search termswhere search terms is a description of the function you want to pull. You do not need to include the language name, as the plugin infers this from the file type of the file you are editing. ###Example Open vim with a python file, say rev.py. Once in the editor, type
:Pull reverse string. The plugin will run for a few seconds, and then insert a method that reverses a string below the cursor position.
##Contributing
Any and all help or improvements on this project is very much welcome. You should start by taking a look at current issues, and seeing what you can fix/improve there.
###Current Contribution Ideas
•Port to Atom text editor
•Use searchcode's api to correctly map more filetypes(echo &filetype) to their id number as assigned by searchcode
•Help me create a psuedo-style language to allow for easy prototyping of functions, that you can pass to the plugin, and have the function built in your code in your preferred language.