Got what you are looking for. Also, as a heads up, the command field really just accepts anything that can be executed via bash, so if you are familiar with any of that, or want to use a language you are comfy with, its an amazingly powerful field. For this I'll use python simply because bash and floating point math dont play well together.
Go to Bundles -> Bundle Editor -> Edit Commands
and select the language that this best fits (if you are looking to apply this across the baord, you may want to use the Source
or Text
bundle.
Create a new Command and for the text, enter in:
#!/usr/bin/env python
from sys import stdin
degF = int( stdin.read() )
degC = (degF - 32) * 5 / 9
print str(degF) + "°F / " + str(degC) + "°C;."
Next set your drop downs such that the Input is Selected Text
and the Output is Replace Selected Text
The activation needs to be Key Equivalent
and then input the keyboard command you wish to cause this to apply.
Finally, choose the scope for this. If you want it available across any type of file, leave this blank. If you want it across all non-code based files, (plain text, html, etc) enter text
. For only code related files, enter source
. Yuo can also get more granular if you wish (source.php
)
Hope that helps!