Ⅰ. 插件描述
Simple JSON ParserⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/parsejson'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/parsejson'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/parsejson'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/ParseJSON
Ⅳ. 文档说明
This plugin does not do anything by itself. This is a recursive-descent
JSON parser intended to be called from other Vim plugins or scripts.
Although it is possible to parse JSON in Vim using eval(), that is
dangerous if the JSON is from an untrusted source.
Note: true, false, and null are parsed to 1, 0, and {} respectively because
there are no equivalents to those values in Vim script.
Usage:
let result = ParseJSON(json_str)
Example:
:echo ParseJSON('{ "hello" : { "a list" : [ 1, 2, "world", true ] }}')
{'hello': {'a list': [1, 2, 'world', 1]}}