Skip to content

Instantly share code, notes, and snippets.

@hparra
Created July 17, 2014 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hparra/67df971dfce5742a72e5 to your computer and use it in GitHub Desktop.
Save hparra/67df971dfce5742a72e5 to your computer and use it in GitHub Desktop.
User KeyBindings to reset emacs-style tabs when using Sublemacs
[
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
"context":
[
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
]
},
{ "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
]
},
{ "keys": ["tab"], "command": "reindent", "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
]
},
{ "keys": ["tab"], "command": "indent", "context":
[
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
]
},
{ "keys": ["tab"], "command": "next_field", "context":
[
{ "key": "has_next_field", "operator": "equal", "operand": true }
]
},
{ "keys": ["tab"], "command": "commit_completion", "context":
[
{ "key": "auto_complete_visible" },
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
{ "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} },
{ "keys": ["shift+tab"], "command": "unindent", "context":
[
{ "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true }
]
},
{ "keys": ["shift+tab"], "command": "unindent", "context":
[
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" }
]
},
{ "keys": ["shift+tab"], "command": "unindent", "context":
[
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
]
},
{ "keys": ["shift+tab"], "command": "prev_field", "context":
[
{ "key": "has_prev_field", "operator": "equal", "operand": true }
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment