All Projects → arzzen → Calc.plugin.zsh

arzzen / Calc.plugin.zsh

Licence: gpl-2.0
zsh calculator - with support for basic math

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Calc.plugin.zsh

Autoenv
Autoenv for zsh
Stars: ✭ 131 (+24.76%)
Mutual labels:  zsh, plugin
Thirsty
Reminds you to drink water - on your terminal.
Stars: ✭ 296 (+181.9%)
Mutual labels:  zsh, plugin
Sheldon
A fast, configurable, shell plugin manager
Stars: ✭ 144 (+37.14%)
Mutual labels:  zsh, plugin
Zsh Lazyload
zsh plugin for lazy load commands and speed up start up time of zsh
Stars: ✭ 33 (-68.57%)
Mutual labels:  zsh, plugin
Z.lua
⚡ A new cd command that helps you navigate faster by learning your habits.
Stars: ✭ 2,164 (+1960.95%)
Mutual labels:  zsh, plugin
Zsh Fzy
Use the fzy fuzzy-finder in Zsh
Stars: ✭ 48 (-54.29%)
Mutual labels:  zsh, plugin
Android Gradle Localization Plugin
Gradle plugin for generating localized string resources
Stars: ✭ 100 (-4.76%)
Mutual labels:  plugin
Trimmer
A Sublime Text plug-in for cleaning up whitespace.
Stars: ✭ 100 (-4.76%)
Mutual labels:  plugin
Pytest Repeat
pytest plugin for repeating test execution
Stars: ✭ 99 (-5.71%)
Mutual labels:  plugin
Close Buffers.vim
📖 Quickly close (bdelete) several buffers at once 📕
Stars: ✭ 99 (-5.71%)
Mutual labels:  plugin
Consulo Unity3d
Frameworks: Unity3D
Stars: ✭ 104 (-0.95%)
Mutual labels:  plugin
Chrome Better History
Replace the default Chrome history with this better history plugin.
Stars: ✭ 103 (-1.9%)
Mutual labels:  plugin
Gitlink
A Jetbrains plugin that opens a local file under Git version control in its remote host using the default browser.
Stars: ✭ 101 (-3.81%)
Mutual labels:  plugin
Climate
The swiss-army knife of utility tools for Linux.
Stars: ✭ 1,372 (+1206.67%)
Mutual labels:  zsh
Floodgate
Hybrid mode plugin to allow for connections from Geyser to join online mode servers.
Stars: ✭ 101 (-3.81%)
Mutual labels:  plugin
Kairos
A non date-based time calculator
Stars: ✭ 100 (-4.76%)
Mutual labels:  calculator
Shadowsocksgostplugin
Gost 的 Shadowsocks 安卓插件,可以直接在 Shadowsocks 安卓客户端上连接 Gost 服务器
Stars: ✭ 104 (-0.95%)
Mutual labels:  plugin
Kibana Object Format
A Kibana plugin for displaying objects and arrays of objects.
Stars: ✭ 100 (-4.76%)
Mutual labels:  plugin
Doctordark
📂 MacForge Plugin to bring dark mode to macOS
Stars: ✭ 100 (-4.76%)
Mutual labels:  plugin
.dot Config
📚 Example dot configs for tmux, tmuxp, vim, vcspull, i3 and awesome
Stars: ✭ 102 (-2.86%)
Mutual labels:  zsh

Simple zsh calculator

This is a calculator which runs on zsh.

Demo

calc demo

Installation

  1. Clone this repository to your favorite path (e.g. ~/.oh-my-zsh/plugins/calc/calc.plugin.zsh)
  2. source the file in your .zshrc
  3. Restart your zsh
# Your .zshrc
source $HOME/.oh-my-zsh/plugins/calc/calc.plugin.zsh

Via antigen

Add to .zshrc

antigen bundle arzzen/calc.plugin.zsh

Via zplug

Add to .zshrc

zplug "arzzen/calc.plugin.zsh"

Usage

# addition
[email protected]:~$ = 5+3
8

# multiplication
[email protected]:~$ = '4*2'
8

# subtraction
[email protected]:~$ = -4-2
-6

# division
[email protected]:~$ = 5.0/2
2.5

# square root
[email protected]:~$ = sqrt(2)
1.41421

# parentheses
[email protected]:~$ = "(6+6)*6"
72

# convert from decimal to hexadecimal

16#FF

# convert from decimal to binary

2#1100

# convert from binary to decimal

12

# convert from hexadecimal to decimal

255

# arctangent
[email protected]:~$ = atan(1)
.785398

# PI value
[email protected]:~$ = PI
3.14159

# more complex
[email protected]:~$ = "3.4+7/8-(5.94*(4*atan(1)))"
-15.2611

Alternative Implementations

# Put these in your .zshrc (No need to install a plugin)
cc() python3 -c "from math import *; print($*);"
alias cc='noglob cc'
# You can use `cc` just like `=` from above. All functions from the math module of Python are available for use. 

Plugin location

.oh-my-zsh
└─── plugins/
     └─── calc/
          └─── calc.plugin.zsh
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].