Skip to content

Instantly share code, notes, and snippets.

@chaonan99
Last active September 24, 2016 01:50
Show Gist options
  • Save chaonan99/937a8ffa6433bb988a8b3859288f093c to your computer and use it in GitHub Desktop.
Save chaonan99/937a8ffa6433bb988a8b3859288f093c to your computer and use it in GitHub Desktop.
My Sublime key map defination
[
// Delete a line
{ "keys": ["ctrl+alt+shift+d"], "command":"run_macro_file", "args": {"file":"Packages/Default/Delete Line.sublime-macro"} },
// ctrl+gb find all
{ "keys": ["ctrl+g", "ctrl+b"],"command": "find_all_under" },
{ "keys": ["alt+up"], "command":"swap_line_up" },
{ "keys": ["alt+down"], "command":"swap_line_down" },
{ "keys": ["alt+/","alt+/"], "command":"insert_best_completion" },
// For markdown preview package. Preview .md in browser.
{ "keys": ["alt+m"], "command": "markdown_preview", "args":{"target": "browser", "parser": "markdown"}},
// Overwrite enter to start a new line, rather than insert a `\n`
{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line.sublime-macro"} },
// Overwrite ctrl+enter to substitute `enter` (insert a new line is more usual)
{ "keys": ["ctrl+enter"], "command": "insert", "args": {"characters": "\n"} },
// Enter key has some other usage. This persist its usage
{ "keys": ["enter"], "command": "find_next", "context":
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
},
{ "keys": ["shift+enter"], "command": "find_prev", "context":
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
},
{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
"context": [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment