gcalc.vim


Ⅰ. 插件描述

This plugin calculates the given expression using the Google Suggest API.

Ⅱ. 基本信息

创建日期:  2012-05-04
使用用户:  1
Github星:  2
插件作者:  tasuten

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'tasuten/gcalc-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'tasuten/gcalc-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'tasuten/gcalc-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/tasuten/gcalc.vim

Ⅳ. 文档说明

# Summary
This plugin calculates the given expression using the Google Suggest API.

Require

Usage

Use like this.

:GCalc 1+1
# => 2
:GCalc e^(pi*i)
# => -1
:GCalc 1km in mile
# => 0.621371192 mile
:GCalc the answer to life the universe and everything
# => 42

Known problems

These problems are caused by Google Suggest API's data format.
This plugin print first element of Google Suggest API's suggest data,
so sometimes this plugin print unwished result.

e.g.

  • a -> 'amazon'

    • It must be error
  • 1/4 -> '1/4-20unc'

    • It must be 0.25
    • You can avoid this problem by doing like this(add space)
    • 1 / 4 -> '0.25'

添加新评论