Guest User

Untitled

a guest
Jul 17th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.12 KB | None | 0 0
  1. [
  2. { "keys": ["d", "n"], "command": "exit_insert_mode",
  3. "context":
  4. [
  5. { "key": "setting.command_mode", "operand": false },
  6. { "key": "setting.is_widget", "operand": false }
  7. ]
  8. },
  9.  
  10. { "keys": ["escape"], "command": "exit_visual_mode",
  11. "context":
  12. [
  13. { "key": "setting.command_mode"},
  14. { "key": "num_selections", "operand": 1},
  15. { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": false }
  16. ]
  17. },
  18.  
  19. { "keys": ["escape"], "command": "hide_auto_complete", "context":
  20. [
  21. { "key": "auto_complete_visible", "operator": "equal", "operand": true }
  22. ]
  23. },
  24.  
  25. { "keys": ["escape"], "command": "vi_cancel_current_action", "context":
  26. [
  27. { "key": "setting.command_mode" },
  28. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false },
  29. { "key": "vi_has_input_state" }
  30. ]
  31. },
  32.  
  33. { "keys": ["ctrl+["], "command": "exit_insert_mode",
  34. "context":
  35. [
  36. { "key": "setting.command_mode", "operand": false },
  37. { "key": "setting.is_widget", "operand": false },
  38. { "key": "setting.vintage_ctrl_keys" }
  39. ]
  40. },
  41.  
  42. { "keys": ["ctrl+["], "command": "exit_visual_mode",
  43. "context":
  44. [
  45. { "key": "setting.command_mode"},
  46. { "key": "num_selections", "operand": 1},
  47. { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": false },
  48. { "key": "setting.vintage_ctrl_keys" }
  49. ]
  50. },
  51.  
  52. { "keys": ["ctrl+["], "command": "vi_cancel_current_action", "context":
  53. [
  54. { "key": "setting.command_mode" },
  55. { "key": "vi_has_input_state" },
  56. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false },
  57. { "key": "setting.vintage_ctrl_keys" }
  58. ]
  59. },
  60.  
  61. { "keys": ["z", "z"], "command" : "center_on_cursor", "context": [{"key": "setting.command_mode"}] },
  62. { "keys": ["z", "g"], "command" : "scroll_cursor_line_to_top", "context": [{"key": "setting.command_mode"}] },
  63. { "keys": ["z", "b"], "command" : "scroll_cursor_line_to_bottom", "context": [{"key": "setting.command_mode"}] },
  64.  
  65. { "keys": ["Z", "Z"], "command" : "vi_save_and_exit", "context": [{"key": "setting.command_mode"}] },
  66.  
  67. { "keys": ["u"], "command": "enter_insert_mode",
  68. "context":
  69. [
  70. {"key": "setting.command_mode"},
  71. {"key": "selection_empty"}
  72. ]
  73. },
  74.  
  75. { "keys": ["U"], "command": "enter_insert_mode", "args":
  76. {"insert_command": "vi_move_to_first_non_white_space_character"},
  77. "context": [{"key": "setting.command_mode"}]
  78. },
  79.  
  80. { "keys": ["U"], "command": "enter_insert_mode",
  81. "args": {"insert_command": "shrink_selections_to_beginning"},
  82. "context": [
  83. {"key": "setting.command_mode"},
  84. {"key": "selection_empty", "operator": "equal", "operand": false}
  85. ]
  86. },
  87.  
  88. { "keys": ["a"], "command": "enter_insert_mode", "args":
  89. {"insert_command": "move", "insert_args": {"by": "characters", "forward": true} },
  90. "context":
  91. [
  92. {"key": "setting.command_mode"},
  93. {"key": "selection_empty"}
  94. ]
  95. },
  96.  
  97. { "keys": ["A"], "command": "enter_insert_mode", "args":
  98. {"insert_command": "move_to", "insert_args": {"to": "hardeol"} },
  99. "context": [{"key": "setting.command_mode"}]
  100. },
  101.  
  102. { "keys": ["A"], "command": "enter_insert_mode",
  103. "args": {"insert_command": "shrink_selections_to_end"},
  104. "context": [
  105. {"key": "setting.command_mode"},
  106. {"key": "selection_empty", "operator": "equal", "operand": false}
  107. ]
  108. },
  109.  
  110. { "keys": ["y"], "command": "enter_insert_mode", "args":
  111. {"insert_command": "run_macro_file", "insert_args": {"file": "Packages/Default/Add Line.sublime-macro"} },
  112. "context": [{"key": "setting.command_mode"}]
  113. },
  114. { "keys": ["y"], "command": "vi_reverse_selections_direction",
  115. "context":
  116. [
  117. {"key": "setting.command_mode"},
  118. {"key": "selection_empty", "operator": "equal", "operand": false}
  119. ]
  120. },
  121.  
  122. { "keys": ["Y"], "command": "enter_insert_mode", "args":
  123. {"insert_command": "run_macro_file", "insert_args": {"file": "Packages/Default/Add Line Before.sublime-macro"} },
  124. "context": [{"key": "setting.command_mode"}]
  125. },
  126.  
  127. { "keys": ["l"], "command": "undo", "context": [{"key": "setting.command_mode"}] },
  128. {
  129. "keys": ["ctrl+r"], "command": "redo",
  130. "context": [{"key": "setting.command_mode"}, {"key": "setting.vintage_ctrl_keys"}]
  131. },
  132.  
  133.  
  134. { "keys": ["l"], "command": "visual_lower_case",
  135. "context":
  136. [
  137. {"key": "setting.command_mode"},
  138. {"key": "selection_empty", "operator": "equal", "operand": false, "match_all": false}
  139. ]
  140. },
  141.  
  142. { "keys": ["L"], "command": "visual_upper_case",
  143. "context":
  144. [
  145. {"key": "setting.command_mode"},
  146. {"key": "selection_empty", "operator": "equal", "operand": false, "match_all": false}
  147. ]
  148. },
  149.  
  150. { "keys": ["v"], "command": "enter_visual_mode",
  151. "context": [{"key": "setting.command_mode"}]
  152. },
  153. { "keys": ["v"], "command": "set_motion_mode", "args": {"mode": "normal"},
  154. "context":
  155. [
  156. {"key": "setting.command_mode"},
  157. {"key": "vi_has_action" }
  158. ]
  159. },
  160. { "keys": ["v"], "command": "exit_visual_mode", "args": {"toggle": true},
  161. "context":
  162. [
  163. {"key": "setting.command_mode"},
  164. {"key": "selection_empty", "operator": "equal", "operand": false, "match_all": false}
  165. ]
  166. },
  167.  
  168. { "keys": ["V"], "command": "enter_visual_line_mode",
  169. "context": [{"key": "setting.command_mode"}]
  170. },
  171. { "keys": ["V"], "command": "enter_visual_line_mode",
  172. "context":
  173. [
  174. {"key": "setting.command_mode"},
  175. {"key": "vi_motion_mode", "operand": "line"}
  176. ]
  177. },
  178. { "keys": ["V"], "command": "set_motion_mode", "args": {"mode": "line"},
  179. "context":
  180. [
  181. {"key": "setting.command_mode"},
  182. {"key": "vi_has_action" }
  183. ]
  184. },
  185.  
  186. { "keys": ["\"", "<character>"], "command": "set_register",
  187. "context": [{"key": "setting.command_mode"}]
  188. },
  189.  
  190. { "keys": [":"], "command": "vi_paste_left",
  191. "context": [{"key": "setting.command_mode"}]
  192. },
  193.  
  194. { "keys": [";"], "command": "vi_paste_right",
  195. "context": [{"key": "setting.command_mode"}]
  196. },
  197.  
  198. { "keys": ["/"], "command": "show_panel", "args":
  199. {
  200. "panel": "incremental_find",
  201. "select_text": false,
  202. "reverse": false
  203. },
  204. "context": [{"key": "setting.command_mode"}]
  205. },
  206. { "keys": ["?"], "command": "show_panel", "args":
  207. {
  208. "panel": "incremental_find",
  209. "select_text": false,
  210. "reverse": true
  211. },
  212. "context": [{"key": "setting.command_mode"}]
  213. },
  214.  
  215. { "keys": ["O"], "command": "show_overlay", "args": {"overlay": "command_palette", "text": ":"},
  216. "context": [{"key": "setting.command_mode"}]
  217. },
  218.  
  219. { "keys": ["*"], "command": "find_under",
  220. "args": {"select_text": false},
  221. "context": [{"key": "setting.command_mode"}]
  222. },
  223.  
  224. { "keys": ["#"], "command": "find_under_prev",
  225. "args": {"select_text": false},
  226. "context": [{"key": "setting.command_mode"}]
  227. },
  228.  
  229. {
  230. "keys": ["k"], "command": "find_next",
  231. "args": {"select_text": false},
  232. "context": [{"key": "setting.command_mode"}]
  233. },
  234. {
  235. "keys": ["K"],
  236. "command": "find_prev",
  237. "args": {"select_text": false},
  238. "context": [{"key": "setting.command_mode"}]
  239. },
  240.  
  241. { "keys": ["N"], "command": "join_lines", "context": [{"key": "setting.command_mode"}] },
  242.  
  243. { "keys": ["."], "command": "repeat", "context": [{"key": "setting.command_mode"}] },
  244.  
  245. { "keys": ["p", "enter"], "command": "replace_character",
  246. "args": {"character": "\n"},
  247. "context": [{"key": "setting.command_mode"}]
  248. },
  249.  
  250. { "keys": ["p", "<character>"], "command": "replace_character",
  251. "context": [{"key": "setting.command_mode"}]
  252. },
  253.  
  254. { "keys": ["X"], "command": "set_action_motion", "args": {
  255. "action": "vi_left_delete",
  256. "motion": null },
  257. "context": [{"key": "setting.command_mode"}]
  258. },
  259.  
  260. { "keys": ["x"], "command": "set_action_motion", "args": {
  261. "action": "vi_right_delete",
  262. "motion": null },
  263. "context": [{"key": "setting.command_mode"}]
  264. },
  265.  
  266. { "keys": ["m", "<character>"], "command": "vi_set_bookmark",
  267. "context": [{"key": "setting.command_mode"}]
  268. },
  269.  
  270. { "keys": ["`", "<character>"], "command": "vi_select_bookmark",
  271. "context": [{"key": "setting.command_mode"}]
  272. },
  273.  
  274. { "keys": ["'", "<character>"], "command": "vi_select_bookmark",
  275. "args": {"select_bol": true},
  276. "context": [{"key": "setting.command_mode"}]
  277. },
  278.  
  279. { "keys": ["~"], "command": "set_action_motion", "args": {
  280. "action": "swap_case",
  281. "motion": "vi_move_by_characters_in_line",
  282. "motion_args": {"forward": true, "extend": true, "visual": false } },
  283. "context":
  284. [
  285. {"key": "selection_empty", "operator": "equal", "operand": true},
  286. {"key": "setting.command_mode"}
  287. ]
  288. },
  289.  
  290. { "keys": ["~"], "command": "swap_case", "context":
  291. [
  292. {"key": "selection_empty", "operator": "equal", "operand": false},
  293. {"key": "setting.command_mode"}
  294. ]
  295. },
  296.  
  297. { "keys": ["q", "<character>"], "command": "vi_begin_record_macro",
  298. "context": [{"key": "setting.command_mode"}]
  299. },
  300.  
  301. { "keys": ["q"], "command": "vi_end_record_macro",
  302. "context": [{"key": "setting.command_mode"}, {"key": "is_recording_macro"}]
  303. },
  304.  
  305. { "keys": ["@", "<character>"], "command": "vi_replay_macro",
  306. "context": [{"key": "setting.command_mode"}]
  307. },
  308.  
  309. { "keys": ["ctrl+j"], "command": "scroll_lines", "args": {"amount": 1.0 },
  310. "context": [{"key": "setting.command_mode"}, {"key": "setting.vintage_ctrl_keys"}]
  311. },
  312. { "keys": ["ctrl+f"], "command": "scroll_lines", "args": {"amount": -1.0 },
  313. "context": [{"key": "setting.command_mode"}, {"key": "setting.vintage_ctrl_keys"}]
  314. },
  315.  
  316. { "keys": ["ctrl+w", "c"], "command": "close",
  317. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  318. },
  319. { "keys": ["ctrl+w", "q"], "command": "close",
  320. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  321. },
  322. { "keys": ["ctrl+w", "y"], "command": "set_layout",
  323. "args":
  324. {
  325. "cols": [0.0, 1.0],
  326. "rows": [0.0, 1.0],
  327. "cells": [[0, 0, 1, 1]]
  328. },
  329. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  330. },
  331.  
  332. { "keys": ["ctrl+w", "r"], "command": "set_layout",
  333. "args":
  334. {
  335. "cols": [0.0, 1.0],
  336. "rows": [0.0, 0.5, 1.0],
  337. "cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
  338. },
  339. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  340. },
  341.  
  342. { "keys": ["ctrl+w", "v"], "command": "set_layout",
  343. "args":
  344. {
  345. "cols": [0.0, 0.5, 1.0],
  346. "rows": [0.0, 1.0],
  347. "cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
  348. },
  349. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  350. },
  351.  
  352. { "keys": ["ctrl+w", "e"], "command": "move_group_focus",
  353. "args": {"direction": "up"},
  354. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  355. },
  356.  
  357. { "keys": ["ctrl+w", "n"], "command": "move_group_focus",
  358. "args": {"direction": "down"},
  359. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  360. },
  361.  
  362. { "keys": ["ctrl+w", "i"], "command": "move_group_focus",
  363. "args": {"direction": "right"},
  364. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  365. },
  366.  
  367. { "keys": ["ctrl+w", "h"], "command": "move_group_focus",
  368. "args": {"direction": "left"},
  369. "context": [{"key": "setting.vintage_ctrl_keys"}, {"key": "setting.command_mode"}]
  370. },
  371.  
  372. //
  373. // Actions
  374. //
  375.  
  376. { "keys": ["s"], "command": "set_action", "args": {
  377. "action": "vi_delete",
  378. "description": "Delete"},
  379. "context": [{"key": "setting.command_mode"}]
  380. },
  381.  
  382. { "keys": ["j"], "command": "set_action", "args": {
  383. "action": "vi_copy",
  384. "description": "Yank"},
  385. "context": [{"key": "setting.command_mode"}]
  386. },
  387.  
  388. { "keys": ["c"], "command": "set_action", "args": {
  389. "action": "enter_insert_mode",
  390. "description": "Change",
  391. "action_args": {"insert_command": "vi_delete"}},
  392. "context": [{"key": "setting.command_mode"}]
  393. },
  394.  
  395. { "keys": ["d", "l"], "command": "set_action", "args": {"action": "lower_case", "description": "Lower Case"},
  396. "context": [{"key": "setting.command_mode"}]
  397. },
  398.  
  399. { "keys": ["d", "L"], "command": "set_action", "args": {"action": "upper_case", "description": "Upper Case"},
  400. "context": [{"key": "setting.command_mode"}]
  401. },
  402.  
  403. { "keys": ["d", "~"], "command": "set_action", "args": {"action": "swap_case", "description": "Swap Case"},
  404. "context": [{"key": "setting.command_mode"}]
  405. },
  406.  
  407. { "keys": ["d", "?"], "command": "set_action", "args": {"action": "rot13", "description": "Rot13"},
  408. "context": [{"key": "setting.command_mode"}]
  409. },
  410.  
  411. { "keys": ["d", "a"], "command": "show_ascii_info",
  412. "context": [{"key": "setting.command_mode"}]
  413. },
  414.  
  415. { "keys": ["d", "t"], "command": "vi_open_file_under_selection",
  416. "context": [{"key": "setting.command_mode"}]
  417. },
  418.  
  419. {
  420. "keys": ["d", "q"], "command": "set_action", "args": {"action": "wrap_lines", "description": "Wrap Lines"},
  421. "context": [{"key": "setting.command_mode"}]
  422. },
  423.  
  424. { "keys": [">"], "command": "set_action", "args": {"action": "vi_indent", "description": "Indent"},
  425. "context": [{"key": "setting.command_mode"}]
  426. },
  427.  
  428. { "keys": ["<"], "command": "set_action", "args": {"action": "vi_unindent", "description": "Unindent"},
  429. "context": [{"key": "setting.command_mode"}]
  430. },
  431.  
  432. { "keys": ["="], "command": "set_action", "args": {"action": "reindent", "description": "Reindent", "action_args": {"force_indent": false}},
  433. "context": [{"key": "setting.command_mode"}]
  434. },
  435.  
  436. //
  437. // Motions
  438. //
  439. { "keys": ["{"], "command": "set_motion", "args": {
  440. "motion": "move",
  441. "motion_args": {"by": "stops", "word_begin": false, "empty_line": true, "separators": "", "forward": false, "extend": true }},
  442. "context": [{"key": "setting.command_mode"}]
  443. },
  444.  
  445. { "keys": ["}"], "command": "set_motion", "args": {
  446. "motion": "move",
  447. "motion_args": {"by": "stops", "word_begin": false, "empty_line": true, "separators": "", "forward": true, "extend": true }},
  448. "context": [{"key": "setting.command_mode"}]
  449. },
  450.  
  451. { "keys": ["W"], "command": "set_motion", "args": {
  452. "motion": "move",
  453. "motion_args": {"by": "stops", "word_begin": true, "empty_line": true, "separators": "", "forward": true, "extend": true },
  454. "clip_to_line": true },
  455. "context": [{"key": "setting.command_mode"}]
  456. },
  457.  
  458. { "keys": ["w"], "command": "set_motion", "args": {
  459. "motion": "move",
  460. "motion_args": {"by": "stops", "word_begin": true, "punct_begin": true, "empty_line": true, "forward": true, "extend": true },
  461. "clip_to_line": true },
  462. "context": [{"key": "setting.command_mode"}]
  463. },
  464.  
  465. { "keys": ["b"], "command": "set_motion", "args": {
  466. "motion": "move",
  467. "motion_args": {"by": "stops", "word_begin": true, "punct_begin": true, "empty_line": true, "forward": false, "extend": true },
  468. "clip_to_line": true },
  469. "context": [{"key": "setting.command_mode"}]
  470. },
  471.  
  472. { "keys": ["B"], "command": "set_motion", "args": {
  473. "motion": "move",
  474. "motion_args": {"by": "stops", "word_begin": true, "empty_line": true, "separators": "", "forward": false, "extend": true },
  475. "clip_to_line": true },
  476. "context": [{"key": "setting.command_mode"}]
  477. },
  478.  
  479. { "keys": ["f"], "command": "set_motion", "args": {
  480. "motion": "move",
  481. "motion_args": {"by": "stops", "word_end": true, "punct_end": true, "empty_line": true, "forward": true, "extend": true },
  482. "inclusive": true,
  483. "clip_to_line": true },
  484. "context": [{"key": "setting.command_mode"}]
  485. },
  486.  
  487. { "keys": ["F"], "command": "set_motion", "args": {
  488. "motion": "move",
  489. "motion_args": {"by": "stops", "word_end": true, "empty_line": true, "separators": "", "forward": true, "extend": true },
  490. "inclusive": true,
  491. "clip_to_line": true },
  492. "context": [{"key": "setting.command_mode"}]
  493. },
  494.  
  495. // Make cw act kinda like ce
  496. { "keys": ["w"], "command": "set_motion", "args": {
  497. "motion": "vi_extend_to_end_of_whitespace_or_word",
  498. "motion_args": {"repeat": 1},
  499. "inclusive": true,
  500. "clip_to_line": true },
  501. "context":
  502. [
  503. {"key": "setting.command_mode"},
  504. {"key": "vi_action", "operand": "enter_insert_mode"}
  505. ]
  506. },
  507.  
  508. // Make cW act kinda like cE
  509. { "keys": ["W"], "command": "set_motion", "args": {
  510. "motion": "vi_extend_to_end_of_whitespace_or_word",
  511. "motion_args": {"repeat": 1, "separators": ""},
  512. "inclusive": true,
  513. "clip_to_line": true },
  514. "context":
  515. [
  516. {"key": "setting.command_mode"},
  517. {"key": "vi_action", "operand": "enter_insert_mode"}
  518. ]
  519. },
  520.  
  521. // Bonus: alt+w and alt+b move by sub-words
  522. { "keys": ["alt+w"], "command": "set_motion", "args": {
  523. "motion": "move",
  524. "motion_args": {"by": "stops", "word_begin": true, "sub_word_begin": true, "punct_begin": true, "empty_line": true, "forward": true, "extend": true },
  525. "clip_to_line": true },
  526. "context": [{"key": "setting.command_mode"}]
  527. },
  528. { "keys": ["alt+w"], "command": "set_motion", "args": {
  529. "motion": "move",
  530. "motion_args": {"by": "stops", "word_end": true, "sub_word_end": true, "punct_end": true, "empty_line": true, "forward": true, "extend": true },
  531. "inclusive": true,
  532. "clip_to_line": true },
  533. "context":
  534. [
  535. {"key": "setting.command_mode"},
  536. {"key": "vi_action", "operand": "enter_insert_mode"}
  537. ]
  538. },
  539. { "keys": ["alt+b"], "command": "set_motion", "args": {
  540. "motion": "move",
  541. "motion_args": {"by": "stops", "word_begin": true, "sub_word_begin": true, "punct_begin": true, "empty_line": true, "forward": false, "extend": true },
  542. "clip_to_line": true },
  543. "context": [{"key": "setting.command_mode"}]
  544. },
  545.  
  546. { "keys": ["$"], "command": "set_motion", "args": {
  547. "motion": "vi_move_to_hard_eol",
  548. "motion_args": {"repeat": 1, "extend": true},
  549. "inclusive": true,
  550. "clip_to_line": true },
  551. "context": [{"key": "setting.command_mode"}]
  552. },
  553.  
  554. { "keys": ["^"], "command": "set_motion", "args": {
  555. "motion": "vi_move_to_first_non_white_space_character",
  556. "motion_args": {"extend": true },
  557. "clip_to_line": true },
  558. "context": [{"key": "setting.command_mode"}]
  559. },
  560.  
  561. { "keys": ["_"], "command": "set_motion", "args": {
  562. "motion": "vi_move_to_first_non_white_space_character",
  563. "motion_args": {"extend": true, "repeat": 1 },
  564. "linewise": true,
  565. "clip_to_line": true },
  566. "context": [{"key": "setting.command_mode"}]
  567. },
  568.  
  569. { "keys": [" "], "command": "set_motion", "args": {
  570. "motion": "vi_move_by_characters",
  571. "motion_args": {"forward": true, "extend": true, "visual": false },
  572. "clip_to_line": true },
  573. "context": [{"key": "setting.command_mode"}]
  574. },
  575.  
  576. { "keys": ["enter"], "command": "set_motion", "args": {
  577. "motion": "move",
  578. "motion_args": {"by": "lines", "forward": true, "extend": true }},
  579. "context": [{"key": "setting.command_mode"}]
  580. },
  581.  
  582. { "keys": ["backspace"], "command": "set_motion", "args": {
  583. "motion": "vi_move_by_characters",
  584. "motion_args": {"forward": false, "extend": true }},
  585. "context": [{"key": "setting.command_mode"}]
  586. },
  587.  
  588. { "keys": ["shift+enter"], "command": "set_motion", "args": {
  589. "motion": "move",
  590. "motion_args": {"by": "lines", "forward": true, "extend": true }},
  591. "context": [{"key": "setting.command_mode"}]
  592. },
  593.  
  594. { "keys": ["i"], "command": "set_motion", "args": {
  595. "motion": "vi_move_by_characters_in_line",
  596. "motion_args": {"forward": true, "extend": true, "visual": false }},
  597. "context": [{"key": "setting.command_mode"}]
  598. },
  599.  
  600. { "keys": ["h"], "command": "set_motion", "args": {
  601. "motion": "vi_move_by_characters_in_line",
  602. "motion_args": {"forward": false, "extend": true }},
  603. "context": [{"key": "setting.command_mode"}]
  604. },
  605.  
  606. { "keys": ["n"], "command": "set_motion", "args": {
  607. "motion": "move",
  608. "motion_args": {"by": "lines", "forward": true, "extend": true },
  609. "linewise": true },
  610. "context": [{"key": "setting.command_mode"}]
  611. },
  612.  
  613. { "keys": ["e"], "command": "set_motion", "args": {
  614. "motion": "move",
  615. "motion_args": {"by": "lines", "forward": false, "extend": true },
  616. "linewise": true },
  617. "context": [{"key": "setting.command_mode"}]
  618. },
  619.  
  620. { "keys": ["D"], "command": "set_motion", "args": {
  621. "motion": "vi_goto_line",
  622. "motion_args": {"repeat": 1, "explicit_repeat": true, "extend": true,
  623. "ending": "eof" },
  624. "linewise": true },
  625. "context": [{"key": "setting.command_mode"}]
  626. },
  627.  
  628. { "keys": ["d", "d"], "command": "set_motion", "args": {
  629. "motion": "vi_goto_line",
  630. "motion_args": {"repeat": 1, "explicit_repeat": true, "extend": true,
  631. "ending": "bof" },
  632. "linewise": true },
  633. "context": [{"key": "setting.command_mode"}]
  634. },
  635.  
  636. { "keys": ["t", "<character>"], "command": "set_motion", "args": {
  637. "motion": "vi_move_to_character",
  638. "motion_args": {"extend": true },
  639. "inclusive": true,
  640. "clip_to_line": true },
  641. "context": [{"key": "setting.command_mode"}]
  642. },
  643.  
  644. { "keys": ["T", "<character>"], "command": "set_motion", "args": {
  645. "motion": "vi_move_to_character",
  646. "motion_args": {"extend": true, "forward": false },
  647. "inclusive": true,
  648. "clip_to_line": true },
  649. "context": [{"key": "setting.command_mode"}]
  650. },
  651.  
  652. { "keys": ["g", "<character>"], "command": "set_motion", "args": {
  653. "motion": "vi_move_to_character",
  654. "motion_args": {"extend": true, "before": true },
  655. "inclusive": true,
  656. "clip_to_line": true },
  657. "context": [{"key": "setting.command_mode"}]
  658. },
  659.  
  660. { "keys": ["G", "<character>"], "command": "set_motion", "args": {
  661. "motion": "vi_move_to_character",
  662. "motion_args": {"extend": true, "forward": false, "before": true },
  663. "inclusive": true,
  664. "clip_to_line": true },
  665. "context": [{"key": "setting.command_mode"}]
  666. },
  667.  
  668. { "keys": ["o"], "command": "set_repeat_move_to_character_motion",
  669. "context": [{"key": "setting.command_mode"}]
  670. },
  671. { "keys": [","], "command": "set_repeat_move_to_character_motion",
  672. "args": {"reverse": true},
  673. "context": [{"key": "setting.command_mode"}]
  674. },
  675.  
  676. { "keys": ["%"], "command": "set_motion", "args": {
  677. "motion": "vi_move_to_brackets",
  678. "motion_args": {"repeat": 1},
  679. "inclusive": true },
  680. "context": [{"key": "setting.command_mode"}]
  681. },
  682.  
  683. { "keys": ["ctrl+t"], "command": "set_motion", "args": {
  684. "motion": "move",
  685. "motion_args": {"by": "pages", "forward": true, "extend": true }},
  686. "context": [{"key": "setting.command_mode"}, {"key": "setting.vintage_ctrl_keys"}]
  687. },
  688.  
  689. { "keys": ["ctrl+b"], "command": "set_motion", "args": {
  690. "motion": "move",
  691. "motion_args": {"by": "pages", "forward": false, "extend": true }},
  692. "context": [{"key": "setting.command_mode"}, {"key": "setting.vintage_ctrl_keys"}]
  693. },
  694.  
  695. { "keys": ["ctrl+l"], "command": "vi_scroll_lines",
  696. "args": {"forward": false},
  697. "context": [{"key": "setting.command_mode"}, {"key": "setting.vintage_ctrl_keys"}]
  698. },
  699.  
  700. { "keys": ["ctrl+s"], "command": "vi_scroll_lines",
  701. "args": {"forward": true},
  702. "context": [{"key": "setting.command_mode"}, {"key": "setting.vintage_ctrl_keys"}]
  703. },
  704.  
  705. { "keys": ["H"], "command": "set_motion", "args": {
  706. "motion": "move_caret_to_screen_top",
  707. "motion_args": {"repeat": 1},
  708. "linewise": true },
  709. "context": [{"key": "setting.command_mode"}]
  710. },
  711. { "keys": ["M"], "command": "set_motion", "args": {
  712. "motion": "move_caret_to_screen_center",
  713. "linewise": true },
  714. "context": [{"key": "setting.command_mode"}]
  715. },
  716. { "keys": ["I"], "command": "set_motion", "args": {
  717. "motion": "move_caret_to_screen_bottom",
  718. "motion_args": {"repeat": 1},
  719. "linewise": true },
  720. "context": [{"key": "setting.command_mode"}]
  721. },
  722.  
  723. { "keys": ["z", "."], "command": "set_motion", "args": {
  724. "motion": "scroll_current_line_to_screen_center",
  725. "motion_args": {"repeat": 1}},
  726. "context": [{"key": "setting.command_mode"}]
  727. },
  728.  
  729. { "keys": ["z", "enter"], "command": "set_motion", "args": {
  730. "motion": "scroll_current_line_to_screen_top",
  731. "motion_args": {"repeat": 1}
  732. },
  733. "context": [{"key": "setting.command_mode"}]
  734. },
  735.  
  736. { "keys": ["z", "y"], "command": "unfold",
  737. "context": [{"key": "setting.command_mode"}]
  738. },
  739.  
  740. { "keys": ["z", "Y"], "command": "unfold",
  741. "context": [{"key": "setting.command_mode"}]
  742. },
  743.  
  744. { "keys": ["z", "c"], "command": "fold",
  745. "context": [{"key": "setting.command_mode"}]
  746. },
  747.  
  748. { "keys": ["z", "C"], "command": "fold",
  749. "context": [{"key": "setting.command_mode"}]
  750. },
  751.  
  752. { "keys": ["z", "k"], "command": "unfold_all",
  753. "context": [{"key": "setting.command_mode"}]
  754. },
  755.  
  756. { "keys": ["z", "P"], "command": "unfold_all",
  757. "context": [{"key": "setting.command_mode"}]
  758. },
  759.  
  760. // Motions to allow double press to mean entire line
  761.  
  762. { "keys": ["c"], "command": "set_motion", "args": {
  763. "motion": "vi_span_count_lines",
  764. "linewise": true,
  765. "motion_args": {"repeat": 1}},
  766. "context":
  767. [
  768. {"key": "setting.command_mode"},
  769. {"key": "vi_action", "operand": "enter_insert_mode"}
  770. ]
  771. },
  772.  
  773. { "keys": ["s"], "command": "set_motion", "args": {
  774. "motion": "expand_selection",
  775. "motion_args": {"to": "line" },
  776. "mode": "normal"},
  777. "context":
  778. [
  779. {"key": "setting.command_mode"},
  780. {"key": "vi_action", "operand": "vi_delete"}
  781. ]
  782. },
  783.  
  784. { "keys": ["j"], "command": "set_motion", "args": {
  785. "motion": "expand_selection",
  786. "motion_args": {"to": "line" },
  787. "mode": "normal"},
  788. "context":
  789. [
  790. {"key": "setting.command_mode"},
  791. {"key": "vi_action", "operand": "vi_copy"}
  792. ]
  793. },
  794.  
  795. { "keys": [">"], "command": "set_motion", "args": {
  796. "motion": "expand_selection",
  797. "motion_args": {"to": "line" },
  798. "mode": "normal"},
  799. "context":
  800. [
  801. {"key": "setting.command_mode"},
  802. {"key": "vi_action", "operand": "vi_indent"}
  803. ]
  804. },
  805.  
  806. { "keys": ["<"], "command": "set_motion", "args": {
  807. "motion": "expand_selection",
  808. "motion_args": {"to": "line" },
  809. "mode": "normal"},
  810. "context":
  811. [
  812. {"key": "setting.command_mode"},
  813. {"key": "vi_action", "operand": "vi_unindent"}
  814. ]
  815. },
  816.  
  817. { "keys": ["="], "command": "set_motion", "args": {
  818. "motion": "expand_selection",
  819. "mode": "normal"},
  820. "context":
  821. [
  822. {"key": "setting.command_mode"},
  823. {"key": "vi_action", "operand": "reindent"}
  824. ]
  825. },
  826.  
  827. // Single key, combined action-motions
  828.  
  829. { "keys": ["S"], "command": "set_action_motion", "args": {
  830. "action": "vi_delete",
  831. "motion": "vi_move_to_hard_eol",
  832. "motion_args": {"repeat": 1, "extend": true},
  833. "motion_inclusive": true },
  834. "context": [{"key": "setting.command_mode"}]
  835. },
  836.  
  837. { "keys": ["C"], "command": "set_action_motion", "args": {
  838. "action": "enter_insert_mode",
  839. "action_args": {"insert_command": "vi_delete"},
  840. "motion": "vi_move_to_hard_eol",
  841. "motion_args": {"repeat": 1, "extend": true},
  842. "motion_inclusive": true },
  843. "context": [{"key": "setting.command_mode"}]
  844. },
  845.  
  846. { "keys": ["J"], "command": "set_action_motion", "args": {
  847. "action": "vi_copy",
  848. "motion": "expand_selection",
  849. "motion_args": {"to": "line" }},
  850. "context": [{"key": "setting.command_mode"}]
  851. },
  852.  
  853. { "keys": ["r"], "command": "set_action_motion", "args": {
  854. "action": "enter_insert_mode",
  855. "action_args": {"insert_command": "vi_delete"},
  856. "motion": "vi_move_by_characters_in_line",
  857. "motion_args": {"forward": true, "extend": true, "visual": false }},
  858. "context": [{"key": "setting.command_mode"}]
  859. },
  860.  
  861. { "keys": ["R"], "command": "set_action_motion", "args": {
  862. "action": "enter_insert_mode",
  863. "action_args": {"insert_command": "vi_delete"},
  864. "motion": "vi_span_count_lines",
  865. "motion_linewise": true,
  866. "motion_args": {"repeat": 1}},
  867. "context": [{"key": "setting.command_mode"}]
  868. },
  869.  
  870. // Text Object motions
  871.  
  872. { "keys": ["u", "w"], "command": "set_motion", "args": {
  873. "motion": "vi_expand_to_words",
  874. "motion_args": {"repeat": 1}},
  875. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  876. },
  877. { "keys": ["a", "w"], "command": "set_motion", "args": {
  878. "motion": "vi_expand_to_words",
  879. "motion_args": {"repeat": 1, "outer": true}},
  880. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  881. },
  882.  
  883. { "keys": ["u", "W"], "command": "set_motion", "args": {
  884. "motion": "vi_expand_to_big_words",
  885. "motion_args": {"repeat": 1}},
  886. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  887. },
  888. { "keys": ["a", "W"], "command": "set_motion", "args": {
  889. "motion": "vi_expand_to_big_words",
  890. "motion_args": {"repeat": 1, "outer": true}},
  891. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  892. },
  893.  
  894. { "keys": ["u", "\""], "command": "set_motion", "args": {
  895. "motion": "vi_expand_to_quotes",
  896. "motion_args": {"character": "\""}},
  897. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  898. },
  899. { "keys": ["a", "\""], "command": "set_motion", "args": {
  900. "motion": "vi_expand_to_quotes",
  901. "motion_args": {"character": "\"", "outer": true}},
  902. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  903. },
  904. { "keys": ["u", "'"], "command": "set_motion", "args": {
  905. "motion": "vi_expand_to_quotes",
  906. "motion_args": {"character": "'"}},
  907. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  908. },
  909. { "keys": ["a", "'"], "command": "set_motion", "args": {
  910. "motion": "vi_expand_to_quotes",
  911. "motion_args": {"character": "'", "outer": true}},
  912. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  913. },
  914.  
  915. { "keys": ["u", "g"], "command": "set_motion", "args": {
  916. "motion": "vi_expand_to_tag"},
  917. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  918. },
  919. { "keys": ["a", "g"], "command": "set_motion", "args": {
  920. "motion": "vi_expand_to_tag",
  921. "motion_args": {"outer": true}},
  922. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  923. },
  924.  
  925. { "keys": ["u", "("], "command": "set_motion", "args": {
  926. "motion": "vi_expand_to_brackets",
  927. "motion_args": {"character": "("}},
  928. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  929. },
  930. { "keys": ["a", "("], "command": "set_motion", "args": {
  931. "motion": "vi_expand_to_brackets",
  932. "motion_args": {"character": "(", "outer": true}},
  933. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  934. },
  935. { "keys": ["u", ")"], "command": "set_motion", "args": {
  936. "motion": "vi_expand_to_brackets",
  937. "motion_args": {"character": "("}},
  938. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  939. },
  940. { "keys": ["a", ")"], "command": "set_motion", "args": {
  941. "motion": "vi_expand_to_brackets",
  942. "motion_args": {"character": "(", "outer": true}},
  943. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  944. },
  945. { "keys": ["u", "b"], "command": "set_motion", "args": {
  946. "motion": "vi_expand_to_brackets",
  947. "motion_args": {"character": "("}},
  948. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  949. },
  950. { "keys": ["a", "b"], "command": "set_motion", "args": {
  951. "motion": "vi_expand_to_brackets",
  952. "motion_args": {"character": "(", "outer": true}},
  953. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  954. },
  955.  
  956. { "keys": ["u", "["], "command": "set_motion", "args": {
  957. "motion": "vi_expand_to_brackets",
  958. "motion_args": {"character": "["}},
  959. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  960. },
  961. { "keys": ["a", "["], "command": "set_motion", "args": {
  962. "motion": "vi_expand_to_brackets",
  963. "motion_args": {"character": "[", "outer": true}},
  964. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  965. },
  966. { "keys": ["u", "]"], "command": "set_motion", "args": {
  967. "motion": "vi_expand_to_brackets",
  968. "motion_args": {"character": "["}},
  969. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  970. },
  971. { "keys": ["a", "]"], "command": "set_motion", "args": {
  972. "motion": "vi_expand_to_brackets",
  973. "motion_args": {"character": "[", "outer": true}},
  974. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  975. },
  976.  
  977. { "keys": ["u", "{"], "command": "set_motion", "args": {
  978. "motion": "vi_expand_to_brackets",
  979. "motion_args": {"character": "{"}},
  980. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  981. },
  982. { "keys": ["a", "{"], "command": "set_motion", "args": {
  983. "motion": "vi_expand_to_brackets",
  984. "motion_args": {"character": "{", "outer": true}},
  985. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  986. },
  987. { "keys": ["u", "}"], "command": "set_motion", "args": {
  988. "motion": "vi_expand_to_brackets",
  989. "motion_args": {"character": "{"}},
  990. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  991. },
  992. { "keys": ["a", "}"], "command": "set_motion", "args": {
  993. "motion": "vi_expand_to_brackets",
  994. "motion_args": {"character": "{", "outer": true}},
  995. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  996. },
  997. { "keys": ["u", "B"], "command": "set_motion", "args": {
  998. "motion": "vi_expand_to_brackets",
  999. "motion_args": {"character": "{"}},
  1000. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  1001. },
  1002. { "keys": ["a", "B"], "command": "set_motion", "args": {
  1003. "motion": "vi_expand_to_brackets",
  1004. "motion_args": {"character": "{", "outer": true}},
  1005. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  1006. },
  1007. { "keys": ["a", ";"], "command": "set_motion", "args": {
  1008. "motion": "expand_selection_to_paragraph"},
  1009. "context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
  1010. },
  1011.  
  1012. //
  1013. // Repeat digits
  1014. //
  1015.  
  1016. { "keys": ["1"], "command": "push_repeat_digit", "args": {"digit": 1},
  1017. "context": [{"key": "setting.command_mode"}]
  1018. },
  1019. { "keys": ["2"], "command": "push_repeat_digit", "args": {"digit": 2},
  1020. "context": [{"key": "setting.command_mode"}]
  1021. },
  1022. { "keys": ["3"], "command": "push_repeat_digit", "args": {"digit": 3},
  1023. "context": [{"key": "setting.command_mode"}]
  1024. },
  1025. { "keys": ["4"], "command": "push_repeat_digit", "args": {"digit": 4},
  1026. "context": [{"key": "setting.command_mode"}]
  1027. },
  1028. { "keys": ["5"], "command": "push_repeat_digit", "args": {"digit": 5},
  1029. "context": [{"key": "setting.command_mode"}]
  1030. },
  1031. { "keys": ["6"], "command": "push_repeat_digit", "args": {"digit": 6},
  1032. "context": [{"key": "setting.command_mode"}]
  1033. },
  1034. { "keys": ["7"], "command": "push_repeat_digit", "args": {"digit": 7},
  1035. "context": [{"key": "setting.command_mode"}]
  1036. },
  1037. { "keys": ["8"], "command": "push_repeat_digit", "args": {"digit": 8},
  1038. "context": [{"key": "setting.command_mode"}]
  1039. },
  1040. { "keys": ["9"], "command": "push_repeat_digit", "args": {"digit": 9},
  1041. "context": [{"key": "setting.command_mode"}]
  1042. },
  1043. { "keys": ["0"], "command": "push_repeat_digit", "args": {"digit": 0},
  1044. "context": [{"key": "setting.command_mode"}]
  1045. },
  1046.  
  1047. // This is a motion, but must come after the above binding
  1048. { "keys": ["0"], "command": "set_motion", "args": {
  1049. "motion": "move_to",
  1050. "motion_args": {"to": "hardbol", "extend": true }},
  1051. "context":
  1052. [
  1053. {"key": "setting.command_mode"},
  1054. {"key": "vi_has_repeat_digit", "operand": false}
  1055. ]
  1056. },
  1057. // Stylus lang fix for proper motion for exiting single and double quotes
  1058. { "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
  1059. [
  1060. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  1061. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  1062. { "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
  1063. { "key": "selector", "operator": "equal", "operand": "source.stylus", "match_all": true}
  1064. ]
  1065. },
  1066. { "keys": ["\""], "command": "move", "args": {"by": "characters", "forward": true}, "context":
  1067. [
  1068. { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
  1069. { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  1070. { "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
  1071. { "key": "selector", "operator": "equal", "operand": "source.stylus", "match_all": true}
  1072. ]
  1073. }
  1074. ]
Add Comment
Please, Sign In to add comment