Ⅰ. 插件描述
vim: interpret a file by function and cache file automaticallyⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'marcweber/vim-addon-mw-utils'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'marcweber/vim-addon-mw-utils'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'marcweber/vim-addon-mw-utils'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/marcweber/vim-addon-mw-utils
Ⅳ. 文档说明
- cached file contents
get some information from files and cache the result.
Reparse the file when it has changed automatically.
- tiny-cmd : Never get the "Press ENTER or type command to continue"
message again - funcref:
- poor man's closures for Vim.
- Create function objects calling autoload function without sourcing that file
- (be lazy, do the work when it has to be done)
- get rid of the "Use upper case letters for custom functions" annoyance
Example:
let myFun = funcref#Function("return ARGS[0]")
let result = funcref#Call(myFun, [2])
let myFun2 = funcref#Function("foo#bar#Baz")
" pass arguments (kind of simple closure):
let myFun2 = funcref#Function("return ARGS", {args: [1]} )
echo funcref#Call(myFun, [2])
echoes [1,2]
" bind function to an object:
let myFun2 = funcref#Function("return SELF.myvalue", {self: {"a": "myvalue"} } )
etc..
This library is used by many of my plugins
If something doesn't work it's a bug. So tell me to fix it!
Reuse this code if you like it!