Skip to content

Instantly share code, notes, and snippets.

@jviereck
Created March 24, 2010 22:12
Show Gist options
  • Save jviereck/342892 to your computer and use it in GitHub Desktop.
Save jviereck/342892 to your computer and use it in GitHub Desktop.
"define metadata";
({
"description": "Standart Key Mapping",
"depends": [ "KeyMapping" ],
"provides": [
{
"ep": "keymapping",
"name": "standart"
}
]
});
"end";
(...)
exports.StandartKeyMapping = StandardMapping.create({
states: {
start: [
{
name: 'Copy to clipboard',
regex: 'ctrl_c'
action: 'copy'
},
{
name: 'Save the current file',
regex: 'ctrl_s',
action: 'command:save'
}
etc. etc.
===========================
For the vi mapping:
exports.VimKeyMapping = StandardMapping.create({
states: {
start: [
{
name: 'Delete n lines',
regex: 'd([0-9]+)d'
action: 'deleteLines'
},
{
name: 'Enter insert mode',
regex: 'i',
then: 'insertMode'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment