keymap.toml 19 KB

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