coc-calc


Ⅰ. 插件描述

Calculate extension for coc.nvim

Ⅱ. 基本信息

创建日期:  2019-05-14
使用用户:  1
Github星:  22
插件作者:  Raidou

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/weirongxu/coc-calc

Ⅳ. 文档说明

# coc-calc

<p align="center">
coc-calc


<img src="https://travis-ci.com/weirongxu/coc-calc.svg?branch=master" alt="Build Status">




Calculate extension for coc.nvim
</p>

Features

screenshot

Usage

  1. Install by coc.nvim command:

    :CocInstall coc-calc
  2. Input calculate expression in any buffer

    sin(PI / 2) =

Keymaps

Create keymappings like:

" append result on current expression
nmap <Leader>ca <Plug>(coc-calc-result-append)
" replace result on current expression
nmap <Leader>cr <Plug>(coc-calc-result-replace)

Configurations

  • calc.priority, calc priority, default: 1000
  • calc.highlight, enable calc highlight, default: true
  • calc.replaceOriginalExpression, enable relace original expression, default: true

Operators

Precedence is from highest to lowest.

OperatorExample
exponentiation **4 ** 3 ** 2 equivalent to 4 ** (3 ** 2)
unary + --2 +2
multiply / divide / remainder * / %4 % 3 4 * 3
addition / subtraction.2 - .1 .1 + .2

Mathematics Constant

  • E
  • PI

Mathematics Functions

abs, acos, acosh, add, asin,
asinh, atan, atanh, atan2, cbrt
ceil, cos, cosh, div, exp,
floor, hypot, ln, log, log2,
log10, max, min, mod, mul,
pow, random, round, sign, sin,
sinh, sqrt, sub, tan, tanh, trunc

Details: http://mikemcl.github.io/decimal.js/#methods

License

MIT

添加新评论