Advertisement
Guest User

Untitled

a guest
Jan 9th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.27 KB | None | 0 0
  1. /*
  2. On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
  3. and don't need to be repeated here. Anything listed here will take precedence, however.
  4. */
  5. [
  6. { "keys": ["super+shift+n"], "command": "new_window" },
  7. { "keys": ["super+shift+w"], "command": "close_window" },
  8. { "keys": ["super+o"], "command": "prompt_open" },
  9. { "keys": ["super+shift+t"], "command": "reopen_last_file" },
  10. { "keys": ["super+alt+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} },
  11. { "keys": ["super+n"], "command": "new_file" },
  12. { "keys": ["super+s"], "command": "save" },
  13. { "keys": ["super+shift+s"], "command": "prompt_save_as" },
  14. { "keys": ["super+alt+s"], "command": "save_all" },
  15. { "keys": ["super+w"], "command": "close" },
  16.  
  17. { "keys": ["super+k", "super+b"], "command": "toggle_side_bar" },
  18. { "keys": ["super+ctrl+f"], "command": "toggle_full_screen" },
  19. { "keys": ["super+ctrl+shift+f"], "command": "toggle_distraction_free" },
  20.  
  21. { "keys": ["super+z"], "command": "undo" },
  22. { "keys": ["super+shift+z"], "command": "redo" },
  23. { "keys": ["super+y"], "command": "redo_or_repeat" },
  24. { "keys": ["super+u"], "command": "soft_undo" },
  25. { "keys": ["super+shift+u"], "command": "soft_redo" },
  26.  
  27. { "keys": ["super+x"], "command": "cut" },
  28. { "keys": ["super+c"], "command": "copy" },
  29. { "keys": ["super+v"], "command": "paste" },
  30. { "keys": ["super+shift+v"], "command": "paste_and_indent" },
  31.  
  32. { "keys": ["ctrl+alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
  33. { "keys": ["ctrl+alt+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
  34. { "keys": ["ctrl+alt+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
  35. { "keys": ["ctrl+alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
  36.  
  37. { "keys": ["ctrl+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
  38. { "keys": ["ctrl+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
  39. { "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
  40. { "keys": ["ctrl+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
  41.  
  42. { "keys": ["ctrl+alt+up"], "command": "scroll_lines", "args": {"amount": 1.0} },
  43. { "keys": ["ctrl+alt+down"], "command": "scroll_lines", "args": {"amount": -1.0} },
  44.  
  45. { "keys": ["ctrl+shift+up"], "command": "select_lines", "args": {"forward": false} },
  46. { "keys": ["ctrl+shift+down"], "command": "select_lines", "args": {"forward": true} },
  47.  
  48. { "keys": ["super+shift+["], "command": "prev_view" },
  49. { "keys": ["super+shift+]"], "command": "next_view" },
  50. { "keys": ["super+alt+left"], "command": "prev_view" },
  51. { "keys": ["super+alt+right"], "command": "next_view" },
  52.  
  53. { "keys": ["ctrl+tab"], "command": "next_view_in_stack" },
  54. { "keys": ["ctrl+shift+tab"], "command": "prev_view_in_stack" },
  55.  
  56. { "keys": ["super+a"], "command": "select_all" },
  57. { "keys": ["super+shift+l"], "command": "split_selection_into_lines" },
  58. { "keys": ["escape"], "command": "single_selection", "context":
  59. [
  60. { "key": "num_selections", "operator": "not_equal", "operand": 1 }
  61. ]
  62. },
  63. { "keys": ["escape"], "command": "clear_fields", "context":
  64. [
  65. { "key": "has_next_field", "operator": "equal", "operand": true }
  66. ]
  67. },
  68. { "keys": ["escape"], "command": "clear_fields", "context":
  69. [
  70. { "key": "has_prev_field", "operator": "equal", "operand": true }
  71. ]
  72. },
  73. { "keys": ["escape"], "command": "hide_panel", "args": {"cancel": true},
  74. "context":
  75. [
  76. { "key": "panel_visible", "operator": "equal", "operand": true }
  77. ]
  78. },
  79. { "keys": ["escape"], "command": "hide_overlay", "context":
  80. [
  81. { "key": "overlay_visible", "operator": "equal", "operand": true }
  82. ]
  83. },
  84. { "keys": ["escape"], "command": "hide_auto_complete", "context":
  85. [
  86. { "key": "auto_complete_visible", "operator": "equal", "operand": true }
  87. ]
  88. },
  89.  
  90. { "keys": ["super+]"], "command": "indent" },
  91. { "keys": ["super+["], "command": "unindent" },
  92.  
  93. { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
  94. { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
  95. "context":
  96. [
  97. { "key": "setting.tab_completion", "operator": "equal", "operand": true }
  98. ]
  99. },
  100. { "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
  101. [
  102. { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
  103. { "key": "setting.tab_completion", "operator": "equal", "operand": true }
  104. ]
  105. },
  106. { "keys": ["tab"], "command": "reindent", "context":
  107. [
  108. { "key": "setting.auto_indent", "operator": "equal", "operand": true },
  109. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  110. { "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
  111. { "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
  112. ]
  113. },
  114. { "keys": ["tab"], "command": "indent", "context":
  115. [
  116. { "key": "text", "operator": "regex_contains", "operand": "\n" }
  117. ]
  118. },
  119. { "keys": ["tab"], "command": "next_field", "context":
  120. [
  121. { "key": "has_next_field", "operator": "equal", "operand": true }
  122. ]
  123. },
  124. { "keys": ["tab"], "command": "commit_completion", "context":
  125. [
  126. { "key": "auto_complete_visible" },
  127. { "key": "setting.auto_complete_commit_on_tab" }
  128. ]
  129. },
  130.  
  131. { "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} },
  132. { "keys": ["shift+tab"], "command": "unindent", "context":
  133. [
  134. { "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true }
  135. ]
  136. },
  137. { "keys": ["shift+tab"], "command": "unindent", "context":
  138. [
  139. { "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" }
  140. ]
  141. },
  142. { "keys": ["shift+tab"], "command": "unindent", "context":
  143. [
  144. { "key": "text", "operator": "regex_contains", "operand": "\n" }
  145. ]
  146. },
  147. { "keys": ["shift+tab"], "command": "prev_field", "context":
  148. [
  149. { "key": "has_prev_field", "operator": "equal", "operand": true }
  150. ]
  151. },
  152.  
  153. { "keys": ["super+l"], "command": "expand_selection", "args": {"to": "line"} },
  154. { "keys": ["super+d"], "command": "find_under_expand" },
  155. { "keys": ["super+k", "super+d"], "command": "find_under_expand_skip" },
  156. { "keys": ["super+shift+space"], "command": "expand_selection", "args": {"to": "scope"} },
  157. { "keys": ["ctrl+shift+m"], "command": "expand_selection", "args": {"to": "brackets"} },
  158. { "keys": ["ctrl+m"], "command": "move_to", "args": {"to": "brackets"} },
  159. { "keys": ["super+shift+j"], "command": "expand_selection", "args": {"to": "indentation"} },
  160. { "keys": ["super+shift+a"], "command": "expand_selection", "args": {"to": "tag"} },
  161.  
  162. { "keys": ["super+alt+."], "command": "close_tag" },
  163.  
  164. { "keys": ["ctrl+q"], "command": "toggle_record_macro" },
  165. { "keys": ["ctrl+shift+q"], "command": "run_macro" },
  166.  
  167. { "keys": ["super+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
  168. { "keys": ["super+shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line Before.sublime-macro"} },
  169. { "keys": ["enter"], "command": "commit_completion", "context":
  170. [
  171. { "key": "auto_complete_visible" },
  172. { "key": "setting.auto_complete_commit_on_tab", "operand": false }
  173. ]
  174. },
  175.  
  176. { "keys": ["super+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
  177. { "keys": ["super+p"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
  178. { "keys": ["super+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
  179. { "keys": ["super+ctrl+p"], "command": "prompt_select_project" },
  180. { "keys": ["super+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
  181. { "keys": ["ctrl+g"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
  182.  
  183. { "keys": ["super+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse":false} },
  184. { "keys": ["super+shift+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse":true} },
  185. { "keys": ["super+f"], "command": "show_panel", "args": {"panel": "find"} },
  186. { "keys": ["super+alt+f"], "command": "show_panel", "args": {"panel": "replace"} },
  187. { "keys": ["super+alt+e"], "command": "replace_next" },
  188. { "keys": ["super+g"], "command": "find_next" },
  189. { "keys": ["super+shift+g"], "command": "find_prev" },
  190. { "keys": ["super+e"], "command": "slurp_find_string" },
  191. { "keys": ["super+shift+e"], "command": "slurp_replace_string" },
  192.  
  193. { "keys": ["alt+super+g"], "command": "find_under" },
  194. { "keys": ["shift+alt+super+g"], "command": "find_under_prev" },
  195. { "keys": ["ctrl+super+g"], "command": "find_all_under" },
  196.  
  197. { "keys": ["super+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files"} },
  198. { "keys": ["f4"], "command": "next_result" },
  199. { "keys": ["shift+f4"], "command": "prev_result" },
  200.  
  201. { "keys": ["f6"], "command": "toggle_setting", "args": {"setting": "spell_check"} },
  202. { "keys": ["ctrl+f6"], "command": "next_misspelling" },
  203. { "keys": ["ctrl+shift+f6"], "command": "prev_misspelling" },
  204.  
  205. { "keys": ["ctrl+super+up"], "command": "swap_line_up" },
  206. { "keys": ["ctrl+super+down"], "command": "swap_line_down" },
  207.  
  208. { "keys": ["ctrl+backspace"], "command": "delete_word", "args": { "forward": false, "sub_words": true } },
  209. { "keys": ["ctrl+delete"], "command": "delete_word", "args": { "forward": true, "sub_words": true } },
  210.  
  211. { "keys": ["super+forward_slash"], "command": "toggle_comment", "args": { "block": false } },
  212. { "keys": ["super+alt+forward_slash"], "command": "toggle_comment", "args": { "block": true } },
  213.  
  214. { "keys": ["super+j"], "command": "join_lines" },
  215. { "keys": ["super+shift+d"], "command": "duplicate_line" },
  216.  
  217. { "keys": ["ctrl+backquote"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
  218.  
  219. { "keys": ["ctrl+space"], "command": "auto_complete" },
  220. { "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
  221. [
  222. { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
  223. { "key": "auto_complete_visible", "operator": "equal", "operand": false },
  224. { "key": "setting.tab_completion", "operator": "equal", "operand": true }
  225. ]
  226. },
  227.  
  228. { "keys": ["super+alt+p"], "command": "show_scope_name" },
  229. { "keys": ["ctrl+shift+p"], "command": "show_scope_name" },
  230.  
  231. { "keys": ["f7"], "command": "build" },
  232. { "keys": ["super+b"], "command": "build" },
  233. { "keys": ["super+shift+b"], "command": "build", "args": {"variant": "Run"} },
  234.  
  235. { "keys": ["ctrl+t"], "command": "transpose" },
  236.  
  237. { "keys": ["f5"], "command": "sort_lines", "args": {"case_sensitive": false} },
  238. { "keys": ["ctrl+f5"], "command": "sort_lines", "args": {"case_sensitive": true} },
  239.  
  240. // Auto-pair quotes
  241. { "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\""}, "context":
  242. [
  243. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  244. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  245. { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
  246. { "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
  247. { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double", "match_all": true }
  248. ]
  249. },
  250. { "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"${0:$SELECTION}\""}, "context":
  251. [
  252. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  253. { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
  254. ]
  255. },
  256. { "keys": ["\""], "command": "move", "args": {"by": "characters", "forward": true}, "context":
  257. [
  258. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  259. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  260. { "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true }
  261. ]
  262. },
  263. { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
  264. [
  265. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  266. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  267. { "key": "preceding_text", "operator": "regex_contains", "operand": "\"$", "match_all": true },
  268. { "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true }
  269. ]
  270. },
  271.  
  272. // Auto-pair single quotes
  273. { "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":
  274. [
  275. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  276. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  277. { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
  278. { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true },
  279. { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }
  280. ]
  281. },
  282. { "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'${0:$SELECTION}'"}, "context":
  283. [
  284. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  285. { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
  286. ]
  287. },
  288. { "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
  289. [
  290. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  291. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  292. { "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true }
  293. ]
  294. },
  295. { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
  296. [
  297. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  298. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  299. { "key": "preceding_text", "operator": "regex_contains", "operand": "'$", "match_all": true },
  300. { "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true }
  301. ]
  302. },
  303.  
  304. // Auto-pair brackets
  305. { "keys": ["("], "command": "insert_snippet", "args": {"contents": "($0)"}, "context":
  306. [
  307. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  308. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  309. { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
  310. ]
  311. },
  312. { "keys": ["("], "command": "insert_snippet", "args": {"contents": "(${0:$SELECTION})"}, "context":
  313. [
  314. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  315. { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
  316. ]
  317. },
  318. { "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
  319. [
  320. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  321. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  322. { "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
  323. ]
  324. },
  325. { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
  326. [
  327. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  328. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  329. { "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },
  330. { "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
  331. ]
  332. },
  333.  
  334. // Auto-pair square brackets
  335. { "keys": ["["], "command": "insert_snippet", "args": {"contents": "[$0]"}, "context":
  336. [
  337. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  338. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  339. { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
  340. ]
  341. },
  342. { "keys": ["["], "command": "insert_snippet", "args": {"contents": "[${0:$SELECTION}]"}, "context":
  343. [
  344. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  345. { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
  346. ]
  347. },
  348. { "keys": ["]"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
  349. [
  350. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  351. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  352. { "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
  353. ]
  354. },
  355. { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
  356. [
  357. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  358. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  359. { "key": "preceding_text", "operator": "regex_contains", "operand": "\\[$", "match_all": true },
  360. { "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
  361. ]
  362. },
  363.  
  364. // Auto-pair curly brackets
  365. { "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context":
  366. [
  367. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  368. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  369. { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }
  370. ]
  371. },
  372. { "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{${0:$SELECTION}}"}, "context":
  373. [
  374. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  375. { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
  376. ]
  377. },
  378. { "keys": ["}"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
  379. [
  380. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  381. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  382. { "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
  383. ]
  384. },
  385. { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
  386. [
  387. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  388. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  389. { "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
  390. { "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
  391. ]
  392. },
  393.  
  394. { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line in Braces.sublime-macro"}, "context":
  395. [
  396. { "key": "setting.auto_indent", "operator": "equal", "operand": true },
  397. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  398. { "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
  399. { "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
  400. ]
  401. },
  402. { "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line in Braces.sublime-macro"}, "context":
  403. [
  404. { "key": "setting.auto_indent", "operator": "equal", "operand": true },
  405. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  406. { "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
  407. { "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
  408. ]
  409. },
  410.  
  411. {
  412. "keys": ["super+alt+1"],
  413. "command": "set_layout",
  414. "args":
  415. {
  416. "cols": [0.0, 1.0],
  417. "rows": [0.0, 1.0],
  418. "cells": [[0, 0, 1, 1]]
  419. }
  420. },
  421. {
  422. "keys": ["super+alt+2"],
  423. "command": "set_layout",
  424. "args":
  425. {
  426. "cols": [0.0, 0.5, 1.0],
  427. "rows": [0.0, 1.0],
  428. "cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
  429. }
  430. },
  431. {
  432. "keys": ["super+alt+3"],
  433. "command": "set_layout",
  434. "args":
  435. {
  436. "cols": [0.0, 0.33, 0.66, 1.0],
  437. "rows": [0.0, 1.0],
  438. "cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1]]
  439. }
  440. },
  441. {
  442. "keys": ["super+alt+4"],
  443. "command": "set_layout",
  444. "args":
  445. {
  446. "cols": [0.0, 0.25, 0.5, 0.75, 1.0],
  447. "rows": [0.0, 1.0],
  448. "cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1]]
  449. }
  450. },
  451. {
  452. "keys": ["super+alt+shift+2"],
  453. "command": "set_layout",
  454. "args":
  455. {
  456. "cols": [0.0, 1.0],
  457. "rows": [0.0, 0.5, 1.0],
  458. "cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
  459. }
  460. },
  461. {
  462. "keys": ["super+alt+shift+3"],
  463. "command": "set_layout",
  464. "args":
  465. {
  466. "cols": [0.0, 1.0],
  467. "rows": [0.0, 0.33, 0.66, 1.0],
  468. "cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]]
  469. }
  470. },
  471. {
  472. "keys": ["super+alt+5"],
  473. "command": "set_layout",
  474. "args":
  475. {
  476. "cols": [0.0, 0.5, 1.0],
  477. "rows": [0.0, 0.5, 1.0],
  478. "cells":
  479. [
  480. [0, 0, 1, 1], [1, 0, 2, 1],
  481. [0, 1, 1, 2], [1, 1, 2, 2]
  482. ]
  483. }
  484. },
  485. { "keys": ["ctrl+1"], "command": "focus_group", "args": { "group": 0 } },
  486. { "keys": ["ctrl+2"], "command": "focus_group", "args": { "group": 1 } },
  487. { "keys": ["ctrl+3"], "command": "focus_group", "args": { "group": 2 } },
  488. { "keys": ["ctrl+4"], "command": "focus_group", "args": { "group": 3 } },
  489. { "keys": ["ctrl+shift+1"], "command": "move_to_group", "args": { "group": 0 } },
  490. { "keys": ["ctrl+shift+2"], "command": "move_to_group", "args": { "group": 1 } },
  491. { "keys": ["ctrl+shift+3"], "command": "move_to_group", "args": { "group": 2 } },
  492. { "keys": ["ctrl+shift+4"], "command": "move_to_group", "args": { "group": 3 } },
  493. { "keys": ["ctrl+0"], "command": "focus_side_bar" },
  494.  
  495. { "keys": ["super+1"], "command": "select_by_index", "args": { "index": 0 } },
  496. { "keys": ["super+2"], "command": "select_by_index", "args": { "index": 1 } },
  497. { "keys": ["super+3"], "command": "select_by_index", "args": { "index": 2 } },
  498. { "keys": ["super+4"], "command": "select_by_index", "args": { "index": 3 } },
  499. { "keys": ["super+5"], "command": "select_by_index", "args": { "index": 4 } },
  500. { "keys": ["super+6"], "command": "select_by_index", "args": { "index": 5 } },
  501. { "keys": ["super+7"], "command": "select_by_index", "args": { "index": 6 } },
  502. { "keys": ["super+8"], "command": "select_by_index", "args": { "index": 7 } },
  503. { "keys": ["super+9"], "command": "select_by_index", "args": { "index": 8 } },
  504. { "keys": ["super+0"], "command": "select_by_index", "args": { "index": 9 } },
  505.  
  506. { "keys": ["f2"], "command": "next_bookmark" },
  507. { "keys": ["shift+f2"], "command": "prev_bookmark" },
  508. { "keys": ["super+f2"], "command": "toggle_bookmark" },
  509. { "keys": ["super+shift+f2"], "command": "clear_bookmarks" },
  510. { "keys": ["alt+f2"], "command": "select_all_bookmarks" },
  511.  
  512. { "keys": ["super+k", "super+u"], "command": "upper_case" },
  513. { "keys": ["super+k", "super+l"], "command": "lower_case" },
  514. { "keys": ["super+k", "super+space"], "command": "set_mark" },
  515. { "keys": ["super+k", "super+a"], "command": "select_to_mark" },
  516. { "keys": ["super+k", "super+w"], "command": "delete_to_mark" },
  517. { "keys": ["super+k", "super+x"], "command": "swap_with_mark" },
  518. { "keys": ["super+k", "super+g"], "command": "clear_bookmarks", "args": {"name": "mark"} },
  519.  
  520. { "keys": ["super+plus"], "command": "increase_font_size" },
  521. { "keys": ["super+equals"], "command": "increase_font_size" },
  522. { "keys": ["super+minus"], "command": "decrease_font_size" },
  523.  
  524. { "keys": ["ctrl+shift+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/long-tag.sublime-snippet" } },
  525.  
  526. { "keys": ["ctrl+shift+k"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
  527.  
  528. { "keys": ["super+alt+q"], "command": "wrap_lines" },
  529.  
  530. { "keys": ["super+alt+["], "command": "fold" },
  531. { "keys": ["super+alt+]"], "command": "unfold" },
  532. { "keys": ["super+k", "super+1"], "command": "fold_by_level", "args": {"level": 1} },
  533. { "keys": ["super+k", "super+2"], "command": "fold_by_level", "args": {"level": 2} },
  534. { "keys": ["super+k", "super+3"], "command": "fold_by_level", "args": {"level": 3} },
  535. { "keys": ["super+k", "super+4"], "command": "fold_by_level", "args": {"level": 4} },
  536. { "keys": ["super+k", "super+5"], "command": "fold_by_level", "args": {"level": 5} },
  537. { "keys": ["super+k", "super+6"], "command": "fold_by_level", "args": {"level": 6} },
  538. { "keys": ["super+k", "super+7"], "command": "fold_by_level", "args": {"level": 7} },
  539. { "keys": ["super+k", "super+8"], "command": "fold_by_level", "args": {"level": 8} },
  540. { "keys": ["super+k", "super+9"], "command": "fold_by_level", "args": {"level": 9} },
  541. { "keys": ["super+k", "super+0"], "command": "unfold_all" },
  542. { "keys": ["super+k", "super+j"], "command": "unfold_all" },
  543. { "keys": ["super+k", "super+t"], "command": "fold_tag_attributes" },
  544.  
  545. { "keys": ["super+alt+o"], "command": "toggle_overwrite" },
  546.  
  547. { "keys": ["alt+f2"], "command": "context_menu" },
  548.  
  549. { "keys": ["super+alt+c"], "command": "toggle_case_sensitive", "context":
  550. [
  551. { "key": "setting.is_widget", "operator": "equal", "operand": true }
  552. ]
  553. },
  554. { "keys": ["super+alt+r"], "command": "toggle_regex", "context":
  555. [
  556. { "key": "setting.is_widget", "operator": "equal", "operand": true }
  557. ]
  558. },
  559. { "keys": ["super+alt+w"], "command": "toggle_whole_word", "context":
  560. [
  561. { "key": "setting.is_widget", "operator": "equal", "operand": true }
  562. ]
  563. },
  564. { "keys": ["super+alt+a"], "command": "toggle_preserve_case", "context":
  565. [
  566. { "key": "setting.is_widget", "operator": "equal", "operand": true }
  567. ]
  568. },
  569.  
  570. // Find panel key bindings
  571. { "keys": ["enter"], "command": "find_next", "context":
  572. [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
  573. },
  574. { "keys": ["shift+enter"], "command": "find_prev", "context":
  575. [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
  576. },
  577. { "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
  578. "context": [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
  579. },
  580.  
  581. // Replace panel key bindings
  582. { "keys": ["enter"], "command": "find_next", "context":
  583. [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
  584. },
  585. { "keys": ["shift+enter"], "command": "find_prev", "context":
  586. [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
  587. },
  588. { "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
  589. "context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
  590. },
  591. { "keys": ["ctrl+alt+enter"], "command": "replace_all", "args": {"close_panel": true},
  592. "context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
  593. },
  594.  
  595. // Incremental find panel key bindings
  596. { "keys": ["enter"], "command": "hide_panel", "context":
  597. [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
  598. },
  599. { "keys": ["shift+enter"], "command": "find_prev", "context":
  600. [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
  601. },
  602. { "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
  603. "context": [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
  604. },
  605.  
  606. { "keys": ["super+,"], "command": "open_file", "args": {"file": "${packages}/User/Preferences.sublime-settings"} },
  607.  
  608. { "keys": ["super+k", "super+y"], "command": "yank" },
  609. { "keys": ["super+k", "super+k"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete to Hard EOL.sublime-macro"} },
  610. { "keys": ["super+k", "super+backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete to Hard BOL.sublime-macro"} },
  611. { "keys": ["super+k", "super+c"], "command": "show_at_center" },
  612.  
  613. // These are OS X built in commands, and don't need to be listed here, but
  614. // doing so lets them show up in the menu
  615. { "keys": ["ctrl+y"], "command": "yank" },
  616. { "keys": ["super+backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete to Hard BOL.sublime-macro"} },
  617. // super+delete isn't a built in command, but makes sense anyway
  618. { "keys": ["super+delete"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete to Hard EOL.sublime-macro"} },
  619. { "keys": ["ctrl+k"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete to Hard EOL.sublime-macro"} },
  620. { "keys": ["ctrl+l"], "command": "show_at_center" },
  621. { "keys": ["ctrl+o"], "command": "insert_snippet", "args": { "contents": "$0\n" } },
  622. { "keys": ["ctrl+super+d"], "command": "noop" },
  623. { "keys": ["ctrl+super+shift+d"], "command": "noop" }
  624. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement