snipt

Ctrl+h for KB shortcuts

VimL

cientific calculator witch vim

" calculadora científica no vim
" url: http://vivaotux.blogspot.com/2009/03/calculadora-cientifica-com-o-vim.html
" se tem suporte a python no vim 
:command! -nargs=+ Calc :py print <args>
:py from math import *

" se você não tem suporte a python no vim mas tem o python instalado faça:
command! -nargs=+ Calc :!python -c "from math import *; print <args>"

" para ler mais dicas como esta: http://code.google.com/p/vimbook
https://snipt.net/embed/acbbd97e9c47360c834b7204be4de2b4/
/raw/acbbd97e9c47360c834b7204be4de2b4/
acbbd97e9c47360c834b7204be4de2b4
vim
VimL
11
2019-06-18T10:38:03
True
False
False
/api/public/snipt/4765/
cientific-calculator-whitc-vim
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c">&quot; calculadora científica no vim</span> </span><span id="L-2"><a name="L-2"></a><span class="c">&quot; url: http://vivaotux.blogspot.com/2009/03/calculadora-cientifica-com-o-vim.html</span> </span><span id="L-3"><a name="L-3"></a><span class="c">&quot; se tem suporte a python no vim </span> </span><span id="L-4"><a name="L-4"></a><span class="p">:</span>command<span class="p">!</span> <span class="p">-</span>nargs<span class="p">=+</span> Calc :<span class="k">py</span> print <span class="p">&lt;</span>args<span class="p">&gt;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">:</span><span class="k">py</span> <span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="o">*</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="c">&quot; se você não tem suporte a python no vim mas tem o python instalado faça:</span> </span><span id="L-8"><a name="L-8"></a>command<span class="p">!</span> <span class="p">-</span>nargs<span class="p">=+</span> Calc :<span class="p">!</span>python <span class="p">-</span><span class="k">c</span> <span class="s2">&quot;from math import *; print &lt;args&gt;&quot;</span> </span><span id="L-9"><a name="L-9"></a> </span><span id="L-10"><a name="L-10"></a><span class="c">&quot; para ler mais dicas como esta: http://code.google.com/p/vimbook</span> </span></pre></div> </td></tr></table>
gvim, python, vim