<file_sep>//
// Demo plugin showing how to add a keybinding
//
define(function(require, exports, module) {
	'use strict';

	var Extensions = require('ft/core/extensions').Extensions;

	Extensions.addInit(function (editor) {
		editor.addKeyMap({
			'Ctrl-A' : function (editor) {
				editor.replaceSelection('â');
			}
		});
	}, Extensions.PriorityLast);
});<file_sep>define(function(require, exports, module) {
	var Extensions = require('ft/core/extensions').Extensions;

	Extensions.addCommand({
		name: 'reverse',
		description: 'Reverse the selected text.',
		performCommand: function (editor) {
			var text = editor.selectedText(),
				reverseText = text.split('').reverse().join('');
			editor.replaceSelection(reverseText, 'around');
		}
	});
});