For vim this definitely works better than Alfred.
When I'm in a vim zone I usually don't use much of the GUI so it might be worthwhile to learn dc better!
Hello! My name is Thomas and I'm a nerd. I like tech and gadgets and speculative fiction, and playing around with programming. It's not my day job, but I'm working on making it a side gig :)
For quick calculations you don't even have to leave vim or pipe out to anything!
<C-r>= in insert mode lets you type mathematical expressions and have the result inserted into your buffer. You need to add a decimal point if you want a floating point result otherwise it truncates to integers.
Bonus tip: [num]<C-a> and [num]<C-x> will add or subtract num from the number under the cursor or the next number on the line if there's no number under the cursor. It defaults to 1 if you leave [num] out.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For vim this definitely works better than Alfred.
When I'm in a vim zone I usually don't use much of the GUI so it might be worthwhile to learn dc better!
For quick calculations you don't even have to leave vim or pipe out to anything!
<C-r>=
in insert mode lets you type mathematical expressions and have the result inserted into your buffer. You need to add a decimal point if you want a floating point result otherwise it truncates to integers.Bonus tip:
[num]<C-a>
and[num]<C-x>
will add or subtract num from the number under the cursor or the next number on the line if there's no number under the cursor. It defaults to 1 if you leave[num]
out.