yazi.toml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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/yazi.json"
  4. [preview]
  5. tab_size = 22
  6. [opener]
  7. edit = [
  8. # { run = 'vim "$@"', desc = "$EDITOR", block = true, for = "unix" },
  9. { run = 'wezterm start --always-new-process -e vim "$@"', orphan = true, desc = "$EDITOR", for = "unix" },
  10. { run = 'code %*', orphan = true, desc = "code", for = "windows" },
  11. { run = 'code -w %*', block = true, desc = "code (block)", for = "windows" },
  12. ]
  13. open = [
  14. { run = 'xdg-open "$1"', desc = "Open", for = "linux" },
  15. { run = 'open "$@"', desc = "Open", for = "macos" },
  16. { run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" },
  17. ]
  18. reveal = [
  19. { run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" },
  20. { run = 'open -R "$1"', desc = "Reveal", for = "macos" },
  21. { run = 'explorer /select, "%1"', orphan = true, desc = "Reveal", for = "windows" },
  22. { run = '''exiftool "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" },
  23. ]
  24. extract = [
  25. { run = 'unar "$1"', desc = "Extract here", for = "unix" },
  26. { run = 'unar "%1"', desc = "Extract here", for = "windows" },
  27. ]
  28. play = [
  29. { run = 'mpv --force-window "$@"', orphan = true, for = "unix" },
  30. { run = 'mpv --force-window "%1"', orphan = true, for = "windows" },
  31. { run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" },
  32. ]
  33. show_font = [
  34. { run = 'gnome-font-viewer "$1"', orphan = true, desc = "Show font", for = "linux" },
  35. ]
  36. show_archive = [
  37. { run = 'engrampa "$1"', orphan = true, desc = "Show archive", for = "linux" },
  38. ]
  39. [open]
  40. rules = [
  41. { name = "*/", use = [ "edit", "open", "reveal" ] },
  42. { mime = "text/*", use = [ "edit", "reveal" ] },
  43. { mime = "image/*", use = [ "open", "reveal" ] },
  44. { mime = "{audio,video}/*", use = [ "open", "play", "reveal" ] },
  45. { mime = "inode/x-empty", use = [ "edit", "reveal" ] },
  46. { mime = "font/*", use = [ "show_font", "open", "reveal" ] },
  47. { mime = "application/vnd.ms-opentype", use = [ "show_font", "open", "reveal" ] },
  48. { mime = "application/{,g}zip", use = [ "show_archive", "extract", "reveal" ] },
  49. { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = [ "show_archive", "extract", "reveal" ] },
  50. # { mime = "application/{,g}zip", use = [ "extract", "reveal" ] },
  51. # { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = [ "extract", "reveal" ] },
  52. { mime = "application/{json,x-ndjson}", use = [ "edit", "reveal" ] },
  53. { mime = "*/javascript", use = [ "edit", "reveal" ] },
  54. { name = "*", use = [ "open", "reveal" ] },
  55. ]