keymap.toml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. # A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
  2. # If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
  3. # "$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
  4. [manager]
  5. keymap = [
  6. # Go to the shell
  7. { on = [ "<C-s>" ], run = 'shell "$SHELL" --block --confirm' },
  8. { on = [ "<Esc>" ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search" },
  9. { on = [ "<C-[>" ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search" },
  10. { on = [ "q" ], run = "quit", desc = "Exit the process" },
  11. { on = [ "Q" ], run = "quit --no-cwd-file", desc = "Exit the process without writing cwd-file" },
  12. { on = [ "<C-c>" ], run = "close", desc = "Close the current tab, or quit if it is last tab" },
  13. { on = [ "<C-z>" ], run = "suspend", desc = "Suspend the process" },
  14. # Navigation
  15. { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" },
  16. { on = [ "j" ], run = "arrow 1", desc = "Move cursor down" },
  17. { on = [ "K" ], run = "arrow -5", desc = "Move cursor up 5 lines" },
  18. { on = [ "J" ], run = "arrow 5", desc = "Move cursor down 5 lines" },
  19. { on = [ "<S-Up>" ], run = "arrow -5", desc = "Move cursor up 5 lines" },
  20. { on = [ "<S-Down>" ], run = "arrow 5", desc = "Move cursor down 5 lines" },
  21. { on = [ "<C-u>" ], run = "arrow -50%", desc = "Move cursor up half page" },
  22. { on = [ "<C-d>" ], run = "arrow 50%", desc = "Move cursor down half page" },
  23. { on = [ "<C-b>" ], run = "arrow -100%", desc = "Move cursor up one page" },
  24. { on = [ "<C-f>" ], run = "arrow 100%", desc = "Move cursor down one page" },
  25. { on = [ "<C-PageUp>" ], run = "arrow -50%", desc = "Move cursor up half page" },
  26. { on = [ "<C-PageDown>" ], run = "arrow 50%", desc = "Move cursor down half page" },
  27. { on = [ "<PageUp>" ], run = "arrow -100%", desc = "Move cursor up one page" },
  28. { on = [ "<PageDown>" ], run = "arrow 100%", desc = "Move cursor down one page" },
  29. { on = [ "h" ], run = "leave", desc = "Go back to the parent directory" },
  30. { on = [ "l" ], run = "enter", desc = "Enter the child directory" },
  31. { on = [ "H" ], run = "back", desc = "Go back to the previous directory" },
  32. { on = [ "L" ], run = "forward", desc = "Go forward to the next directory" },
  33. { on = [ "<C-k>" ], run = "seek -5", desc = "Seek up 5 units in the preview" },
  34. { on = [ "<C-j>" ], run = "seek 5", desc = "Seek down 5 units in the preview" },
  35. { on = [ "<A-k>" ], run = "seek -5", desc = "Seek up 5 units in the preview" },
  36. { on = [ "<A-j>" ], run = "seek 5", desc = "Seek down 5 units in the preview" },
  37. { on = [ "<A-PageUp>" ], run = "seek -5", desc = "Seek up 5 units in the preview" },
  38. { on = [ "<A-PageDown>" ], run = "seek 5", desc = "Seek down 5 units in the preview" },
  39. { on = [ "<Up>" ], run = "arrow -1", desc = "Move cursor up" },
  40. { on = [ "<Down>" ], run = "arrow 1", desc = "Move cursor down" },
  41. { on = [ "<Left>" ], run = "leave", desc = "Go back to the parent directory" },
  42. { on = [ "<Right>" ], run = "enter", desc = "Enter the child directory" },
  43. { on = [ "g", "g" ], run = "arrow -99999999", desc = "Go to the top" },
  44. { on = [ "G" ], run = "arrow 99999999", desc = "Go to the bottom" },
  45. # Selection
  46. { on = [ "<Space>" ], run = [ "select --state=none", "arrow 1" ], desc = "Toggle the current selection state" },
  47. { on = [ "v" ], run = "visual_mode", desc = "Enter visual mode (selection mode)" },
  48. { on = [ "V" ], run = "visual_mode --unset", desc = "Enter visual mode (unset mode)" },
  49. { on = [ "<C-a>" ], run = "select_all --state=true", desc = "Select all files" },
  50. { on = [ "<C-r>" ], run = "select_all --state=none", desc = "Inverse selection of all files" },
  51. # Operation
  52. { on = [ "o" ], run = "open", desc = "Open the selected files" },
  53. { on = [ "O" ], run = "open --interactive", desc = "Open the selected files interactively" },
  54. { on = [ "<Enter>" ], run = "open", desc = "Open the selected files" },
  55. { on = [ "<S-Enter>" ], run = "open --interactive", desc = "Open the selected files interactively" },
  56. { on = [ "y" ], run = "yank", desc = "Copy the selected files" },
  57. { on = [ "Y" ], run = "unyank", desc = "Cancel the yank status of files" },
  58. { on = [ "x" ], run = "yank --cut", desc = "Cut the selected files" },
  59. { on = [ "X" ], run = "unyank", desc = "Cancel the yank status of files" },
  60. { on = [ "p" ], run = "paste", desc = "Paste the files" },
  61. { on = [ "P" ], run = "paste --force", desc = "Paste the files (overwrite if the destination exists)" },
  62. { on = [ "-" ], run = "link", desc = "Symlink the absolute path of files" },
  63. { on = [ "_" ], run = "link --relative", desc = "Symlink the relative path of files" },
  64. { on = [ "d" ], run = "remove", desc = "Move the files to the trash" },
  65. { on = [ "D" ], run = "remove --permanently", desc = "Permanently delete the files" },
  66. { on = [ "a" ], run = "create", desc = "Create a file or directory (ends with / for directories)" },
  67. { on = [ "r" ], run = "rename --cursor=before_ext", desc = "Rename a file or directory" },
  68. { on = [ ";" ], run = "shell", desc = "Run a shell command" },
  69. { on = [ ":" ], run = "shell --block", desc = "Run a shell command (block the UI until the command finishes)" },
  70. { on = [ "." ], run = "hidden toggle", desc = "Toggle the visibility of hidden files" },
  71. { on = [ "s" ], run = "search fd", desc = "Search files by name using fd" },
  72. { on = [ "S" ], run = "search rg", desc = "Search files by content using ripgrep" },
  73. { on = [ "<C-s>" ], run = "search none", desc = "Cancel the ongoing search" },
  74. { on = [ "z" ], run = "plugin zoxide", desc = "Jump to a directory using zoxide" },
  75. { on = [ "Z" ], run = "plugin fzf", desc = "Jump to a directory, or reveal a file using fzf" },
  76. # Linemode
  77. { on = [ "m", "s" ], run = "linemode size", desc = "linemode to size" },
  78. { on = [ "m", "p" ], run = "linemode permissions", desc = "linemode to permissions" },
  79. { on = [ "m", "m" ], run = "linemode mtime", desc = "linemode to mtime" },
  80. { on = [ "m", "n" ], run = "linemode none", desc = "linemode to none" },
  81. # Copy
  82. { on = [ "c", "c" ], run = "copy path", desc = "Copy abs path" },
  83. { on = [ "c", "d" ], run = "copy dirname", desc = "Copy dirname" },
  84. { on = [ "c", "f" ], run = "copy filename", desc = "Copy filename" },
  85. { on = [ "c", "n" ], run = "copy name_without_ext", desc = "Copy filename no extension" },
  86. # Filter
  87. { on = [ "f" ], run = "filter --smart", desc = "Filter the files" },
  88. # Find
  89. { on = [ "/" ], run = "find --smart", desc = "Find next file" },
  90. { on = [ "?" ], run = "find --previous --smart", desc = "Find previous file" },
  91. { on = [ "n" ], run = "find_arrow", desc = "Go to next found file" },
  92. { on = [ "N" ], run = "find_arrow --previous", desc = "Go to previous found file" },
  93. # Sorting
  94. { on = [ ",", "m" ], run = "sort modified --reverse=no", desc = "Sort by modified time" },
  95. { on = [ ",", "M" ], run = "sort modified --reverse", desc = "Sort by modified time (reverse)" },
  96. { on = [ ",", "c" ], run = "sort created --reverse=no", desc = "Sort by created time" },
  97. { on = [ ",", "C" ], run = "sort created --reverse", desc = "Sort by created time (reverse)" },
  98. { on = [ ",", "e" ], run = "sort extension --reverse=no", desc = "Sort by extension" },
  99. { on = [ ",", "E" ], run = "sort extension --reverse", desc = "Sort by extension (reverse)" },
  100. { on = [ ",", "a" ], run = "sort alphabetical --reverse=no", desc = "Sort alphabetically" },
  101. { on = [ ",", "A" ], run = "sort alphabetical --reverse", desc = "Sort alphabetically (reverse)" },
  102. { on = [ ",", "n" ], run = "sort natural --reverse=no", desc = "Sort naturally" },
  103. { on = [ ",", "N" ], run = "sort natural --reverse", desc = "Sort naturally (reverse)" },
  104. { on = [ ",", "s" ], run = "sort size --reverse=no", desc = "Sort by size" },
  105. { on = [ ",", "S" ], run = "sort size --reverse", desc = "Sort by size (reverse)" },
  106. # Tabs
  107. { on = [ "t" ], run = "tab_create --current", desc = "Create a new tab using the current path" },
  108. { on = [ "1" ], run = "tab_switch 0", desc = "Switch to the first tab" },
  109. { on = [ "2" ], run = "tab_switch 1", desc = "Switch to the second tab" },
  110. { on = [ "3" ], run = "tab_switch 2", desc = "Switch to the third tab" },
  111. { on = [ "4" ], run = "tab_switch 3", desc = "Switch to the fourth tab" },
  112. { on = [ "5" ], run = "tab_switch 4", desc = "Switch to the fifth tab" },
  113. { on = [ "6" ], run = "tab_switch 5", desc = "Switch to the sixth tab" },
  114. { on = [ "7" ], run = "tab_switch 6", desc = "Switch to the seventh tab" },
  115. { on = [ "8" ], run = "tab_switch 7", desc = "Switch to the eighth tab" },
  116. { on = [ "9" ], run = "tab_switch 8", desc = "Switch to the ninth tab" },
  117. { on = [ "[" ], run = "tab_switch -1 --relative", desc = "Switch to the previous tab" },
  118. { on = [ "]" ], run = "tab_switch 1 --relative", desc = "Switch to the next tab" },
  119. { on = [ "{" ], run = "tab_swap -1", desc = "Swap the current tab with the previous tab" },
  120. { on = [ "}" ], run = "tab_swap 1", desc = "Swap the current tab with the next tab" },
  121. # Tasks
  122. { on = [ "w" ], run = "tasks_show", desc = "Show the tasks manager" },
  123. # Goto
  124. { on = [ "g", "R" ], run = "cd /", desc = "Go /" },
  125. { on = [ "g", "M" ], run = "cd /run/media", desc = "Go /run/media" },
  126. { on = [ "g", "a" ], run = "cd ~/.cache", desc = "Go ~/.cache" },
  127. { on = [ "g", "b" ], run = "cd ~/OS/Linux/+backup", desc = "Go ~/../+backup" },
  128. { on = [ "g", "c" ], run = "cd ~/.config", desc = "Go ~/.config" },
  129. { on = [ "g", "d" ], run = "cd ~/Desktop", desc = "Go ~/Desktop" },
  130. { on = [ "g", "h" ], run = "cd ~", desc = "Go ~" },
  131. { on = [ "g", "l" ], run = "cd ~/.local", desc = "Go ~/.local" },
  132. { on = [ "g", "p" ], run = "cd ~/Projects", desc = "Go ~/Projects" },
  133. { on = [ "g", "s" ], run = "cd ~/.myScripts", desc = "Go ~/.myScripts" },
  134. { on = [ "g", "w" ], run = "cd ~/Downloads", desc = "Go ~/Downloads" },
  135. { on = [ "g", "<Space>" ], run = "cd --interactive", desc = "Go to a directory" },
  136. # Help
  137. { on = [ "~" ], run = "help", desc = "Open help" },
  138. ]
  139. [tasks]
  140. keymap = [
  141. { on = [ "<Esc>" ], run = "close", desc = "Hide the task manager" },
  142. { on = [ "<C-[>" ], run = "close", desc = "Hide the task manager" },
  143. { on = [ "<C-c>" ], run = "close", desc = "Hide the task manager" },
  144. { on = [ "w" ], run = "close", desc = "Hide the task manager" },
  145. { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" },
  146. { on = [ "j" ], run = "arrow 1", desc = "Move cursor down" },
  147. { on = [ "<Up>" ], run = "arrow -1", desc = "Move cursor up" },
  148. { on = [ "<Down>" ], run = "arrow 1", desc = "Move cursor down" },
  149. { on = [ "<Enter>" ], run = "inspect", desc = "Inspect the task" },
  150. { on = [ "x" ], run = "cancel", desc = "Cancel the task" },
  151. { on = [ "~" ], run = "help", desc = "Open help" }
  152. ]
  153. [select]
  154. keymap = [
  155. { on = [ "<Esc>" ], run = "close", desc = "Cancel selection" },
  156. { on = [ "<C-[>" ], run = "close", desc = "Cancel selection" },
  157. { on = [ "<C-c>" ], run = "close", desc = "Cancel selection" },
  158. { on = [ "<Enter>" ], run = "close --submit", desc = "Submit the selection" },
  159. { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" },
  160. { on = [ "j" ], run = "arrow 1", desc = "Move cursor down" },
  161. { on = [ "K" ], run = "arrow -5", desc = "Move cursor up 5 lines" },
  162. { on = [ "J" ], run = "arrow 5", desc = "Move cursor down 5 lines" },
  163. { on = [ "<Up>" ], run = "arrow -1", desc = "Move cursor up" },
  164. { on = [ "<Down>" ], run = "arrow 1", desc = "Move cursor down" },
  165. { on = [ "<S-Up>" ], run = "arrow -5", desc = "Move cursor up 5 lines" },
  166. { on = [ "<S-Down>" ], run = "arrow 5", desc = "Move cursor down 5 lines" },
  167. { on = [ "~" ], run = "help", desc = "Open help" }
  168. ]
  169. [input]
  170. keymap = [
  171. { on = [ "<C-c>" ], run = "close", desc = "Cancel input" },
  172. { on = [ "<Enter>" ], run = "close --submit", desc = "Submit the input" },
  173. { on = [ "<Esc>" ], run = "escape", desc = "Go back the normal mode, or cancel input" },
  174. { on = [ "<C-[>" ], run = "escape", desc = "Go back the normal mode, or cancel input" },
  175. # Mode
  176. { on = [ "i" ], run = "insert", desc = "Enter insert mode" },
  177. { on = [ "a" ], run = "insert --append", desc = "Enter append mode" },
  178. { on = [ "I" ], run = [ "move -999", "insert" ], desc = "Move to the BOL, and enter insert mode" },
  179. { on = [ "A" ], run = [ "move 999", "insert --append" ], desc = "Move to the EOL, and enter append mode" },
  180. { on = [ "v" ], run = "visual", desc = "Enter visual mode" },
  181. { on = [ "V" ], run = [ "move -999", "visual", "move 999" ], desc = "Enter visual mode and select all" },
  182. # Character-wise movement
  183. { on = [ "h" ], run = "move -1", desc = "Move back a character" },
  184. { on = [ "l" ], run = "move 1", desc = "Move forward a character" },
  185. { on = [ "<Left>" ], run = "move -1", desc = "Move back a character" },
  186. { on = [ "<Right>" ], run = "move 1", desc = "Move forward a character" },
  187. { on = [ "<C-b>" ], run = "move -1", desc = "Move back a character" },
  188. { on = [ "<C-f>" ], run = "move 1", desc = "Move forward a character" },
  189. # Word-wise movement
  190. { on = [ "b" ], run = "backward", desc = "Move back to the start of the current or previous word" },
  191. { on = [ "w" ], run = "forward", desc = "Move forward to the start of the next word" },
  192. { on = [ "e" ], run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" },
  193. { on = [ "<A-b>" ], run = "backward", desc = "Move back to the start of the current or previous word" },
  194. { on = [ "<A-f>" ], run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" },
  195. # Line-wise movement
  196. { on = [ "0" ], run = "move -999", desc = "Move to the BOL" },
  197. { on = [ "$" ], run = "move 999", desc = "Move to the EOL" },
  198. { on = [ "<C-a>" ], run = "move -999", desc = "Move to the BOL" },
  199. { on = [ "<C-e>" ], run = "move 999", desc = "Move to the EOL" },
  200. { on = [ "<Home>" ], run = "move -999", desc = "Move to the BOL" },
  201. { on = [ "<End>" ], run = "move 999", desc = "Move to the EOL" },
  202. # Delete
  203. { on = [ "<Backspace>" ], run = "backspace", desc = "Delete the character before the cursor" },
  204. { on = [ "<Delete>" ], run = "backspace --under", desc = "Delete the character under the cursor" },
  205. { on = [ "<C-h>" ], run = "backspace", desc = "Delete the character before the cursor" },
  206. { on = [ "<C-d>" ], run = "backspace --under", desc = "Delete the character under the cursor" },
  207. # Kill
  208. { on = [ "<C-u>" ], run = "kill bol", desc = "Kill backwards to the BOL" },
  209. { on = [ "<C-k>" ], run = "kill eol", desc = "Kill forwards to the EOL" },
  210. { on = [ "<C-w>" ], run = "kill backward", desc = "Kill backwards to the start of the current word" },
  211. { on = [ "<A-d>" ], run = "kill forward", desc = "Kill forwards to the end of the current word" },
  212. # Cut/Yank/Paste
  213. { on = [ "d" ], run = "delete --cut", desc = "Cut the selected characters" },
  214. { on = [ "D" ], run = [ "delete --cut", "move 999" ], desc = "Cut until the EOL" },
  215. { on = [ "c" ], run = "delete --cut --insert", desc = "Cut the selected characters, and enter insert mode" },
  216. { on = [ "C" ], run = [ "delete --cut --insert", "move 999" ], desc = "Cut until the EOL, and enter insert mode" },
  217. { on = [ "x" ], run = [ "delete --cut", "move 1 --in-operating" ], desc = "Cut the current character" },
  218. { on = [ "y" ], run = "yank", desc = "Copy the selected characters" },
  219. { on = [ "p" ], run = "paste", desc = "Paste the copied characters after the cursor" },
  220. { on = [ "P" ], run = "paste --before", desc = "Paste the copied characters before the cursor" },
  221. # Undo/Redo
  222. { on = [ "u" ], run = "undo", desc = "Undo the last operation" },
  223. { on = [ "<C-r>" ], run = "redo", desc = "Redo the last operation" },
  224. # Help
  225. { on = [ "~" ], run = "help", desc = "Open help" }
  226. ]
  227. [completion]
  228. keymap = [
  229. { on = [ "<C-c>" ], run = "close", desc = "Cancel completion" },
  230. { on = [ "<Tab>" ], run = "close --submit", desc = "Submit the completion" },
  231. { on = [ "<Enter>" ], run = [ "close --submit", "close_input --submit" ], desc = "Submit the completion and input" },
  232. { on = [ "<A-k>" ], run = "arrow -1", desc = "Move cursor up" },
  233. { on = [ "<A-j>" ], run = "arrow 1", desc = "Move cursor down" },
  234. { on = [ "<Up>" ], run = "arrow -1", desc = "Move cursor up" },
  235. { on = [ "<Down>" ], run = "arrow 1", desc = "Move cursor down" },
  236. { on = [ "<C-p>" ], run = "arrow -1", desc = "Move cursor up" },
  237. { on = [ "<C-n>" ], run = "arrow 1", desc = "Move cursor down" },
  238. { on = [ "~" ], run = "help", desc = "Open help" }
  239. ]
  240. [help]
  241. keymap = [
  242. { on = [ "<Esc>" ], run = "escape", desc = "Clear the filter, or hide the help" },
  243. { on = [ "<C-[>" ], run = "escape", desc = "Clear the filter, or hide the help" },
  244. { on = [ "q" ], run = "close", desc = "Exit the process" },
  245. { on = [ "<C-c>" ], run = "close", desc = "Hide the help" },
  246. # Navigation
  247. { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" },
  248. { on = [ "j" ], run = "arrow 1", desc = "Move cursor down" },
  249. { on = [ "K" ], run = "arrow -5", desc = "Move cursor up 5 lines" },
  250. { on = [ "J" ], run = "arrow 5", desc = "Move cursor down 5 lines" },
  251. { on = [ "<Up>" ], run = "arrow -1", desc = "Move cursor up" },
  252. { on = [ "<Down>" ], run = "arrow 1", desc = "Move cursor down" },
  253. { on = [ "<S-Up>" ], run = "arrow -5", desc = "Move cursor up 5 lines" },
  254. { on = [ "<S-Down>" ], run = "arrow 5", desc = "Move cursor down 5 lines" },
  255. # Filtering
  256. { on = [ "/" ], run = "filter", desc = "Apply a filter for the help items" },
  257. ]