Vim: Scientific calculator using python3

A couple of years ago I have been writing a post on this blog showing how to use python on vim in order to get scientific math results. Now, a little bit overdue I am proud of show you the same solution using python3.
" copy these lines to your ~/.vimrc
" Scientifc Calculator using python3 --> :Calc sin(30)
" :Calc sum([x^2 for x in range(100)])
command! -nargs=+ Calc :py print(<args>)
py from math import *
" you can also create a bash or zsh alias like:
" alias calc='python3 -ic "from math import *; import cmath"'
" the alias tip came from:
" https://www.reddit.com/r/linux/comments/3ly2zl/lpt_use_python_interpreter_as_an_advanced/
view raw pythoncalc.viml hosted with ❤ by GitHub

Maybe it will be improvements, I hope so.

linux-cookbook

Grupos do Google
Participe do grupo linux-cookbook
E-mail:
Visitar este grupo