Updated Profanity. Now it reads highlights, layouts, macros and other key mappings from an xml file. It will create a file named .profanity.xml in your home directory if it doesn't exist. You might be able to figure out what to change from all the default settings in the file, but there's a good amount of non-obvious stuff in there.
None of the default highlights set a background color, but adding a bg='123456' attribute to a highlight tag is supported.
There's no option to highlight the entire line or make it case insensive or only on word boundary, but these can all be specified using regex. Adding .* to the front and end will highlight the entire line. Putting (?i) in the regex causes the rest of the regex to be case insensitive. \b matches a word boundary.
The terminal emulator you use and/or ncurses puts a lot of limitations on the key bindings. ctrl+a through ctrl+z get sent to the script with a value of 1 through 26, which causes both the tab key and ctrl+i have a value of 9. Ctrl+h and backspace on Windows both have a value of 8. Ctrl+j and enter are both 10. Assigning a macro or other action to one of these will cause the other to do the same thing. Ctrl+c, ctrl+q, ctrl+s, and ctrl+z don't even make it to the script.
Most of the time, the alt key doesn't modify another key, but instead is just sent with a value of 27 (same as escape) before the other key value. This is why there are nested key tags in the xml file, which looks like this:
Code:
<key id='alt'>
<key id='f' macro='something'/>
</key>
This makes alt+f work with the weird way the key values are being sent to the script, but also opens up a lot of other options. For example, if you wanted to use ctrl+g to get your weapon out, but you have a lot of weapons, you could do something like this:
Code:
<key id='ctrl+g'>
<key id='d' macro='\xget my dagger\r'/>
<key id='b' macro='\xget my broadsword\r'/>
<key id='h' macro='\xstow right\rget my handaxe\r'/>
<key id='s' macro='\xremove my shield\r'/>
</key>
Now when you hit ctrl+g and let go and hit b, it gets out your broadsword. There's no limit to the number of levels of nested key tags. You'll need three levels instead of two to do the same thing with alt.
ctrl+enter is the same as enter, so for resending the last and second last commands to the game I went with ctrl+up and alt+up. Seemed like a good fit, since the up key moves you through the command history, but you can change those keys and pretty much everything else if you want.
Macros work the same as WizardFE and Stormfront, except that %variable and /? aren't implemented yet. You can use \x \r and @.
The layout is there too..