OSX vs Vim: a war for the Function keys
Palua

Palua lets you set the 'standard function keys' setting for individual apps only.


  With Palua, you just need one click - or one hotkey - to toggle the mode your Fx keys are.




KeyRemap4Macbook

&lt;?xml version="1.0"?&gt;
&lt;root&gt;
  &lt;appdef&gt;
    &lt;appname&gt;TERMINAL&lt;/appname&gt;
    &lt;equal&gt;com.apple.Terminal&lt;/equal&gt;
  &lt;/appdef&gt;
  &lt;item&gt;
    &lt;name&gt;FunctionforF4&lt;/name&gt;
    &lt;identifier&gt;FunctionforF4&lt;/identifier&gt;
    &lt;only&gt;TERMINAL&lt;/only&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::LAUNCHPAD, KeyCode::F4&lt;/autogen&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::F4, KeyCode::LAUNCHPAD&lt;/autogen&gt;
  &lt;/item&gt;
&lt;/root&gt;


For other keys have a look at the key list.