1
Doing calculations in VIM
2
Every now and then you have to perform some calculations. The most common use case for me is determining the size of an
3
element. I used to do these by opening a TMUX split and executing something like this:
4
5
expr 73 \* 446
7
However, there is an easier way where you can get the result written to your buffer. When in INSERT mode simply hit
8
"CTRL-r" followed by "=" then write your calculation and hit enter. It will insert the result at your cursor position.
8
9
The end
10
I usually tweet something when I've finished writing a new post. You can find me on Twitter
11
by clickingÂ