I just found a way to use vim as a calculator by using a Ruby one liner.
:!ruby -e 'puts 5*2'
will open a cmd window and output the result.
If you want to read the result into your vim buffer use:
:r!ruby -e 'puts 74/5.0'
You can even use the contents of a register in the calculation command
by yanking to a register:  select text then "ay will yank to register 'a'.
then in the command paste from the 'a' register:  <C-R>a.
I then I used this in a keyboard macro and it worked great.
I hope you find this tip useful.
Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to