My build of nnn with minor changes
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

83 行
3.1 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. #define CWD "cwd: "
  3. #define CURSR " > "
  4. #define EMPTY " "
  5. static int mtimeorder = 0; /* Set to 1 to sort by time modified */
  6. static int sizeorder = 0; /* Set to 1 to sort by file size */
  7. static int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
  8. static int showhidden = 0; /* Set to 1 to show hidden files by default */
  9. static int showdetail = 0; /* Set to show additional file info */
  10. static char *idlecmd = "rain"; /* The screensaver program */
  11. struct assoc assocs[] = {
  12. //{ "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", "mpv" },
  13. { "\\.(c|cpp|h|txt|log|sh)$", "vi" },
  14. { "\\.(wma|mp3|ogg|flac)$", "mpv" },
  15. //{ "\\.(png|jpg|gif)$", "feh" },
  16. //{ "\\.(html|svg)$", "firefox" },
  17. { "\\.pdf$", "zathura" },
  18. //{ "\\.sh$", "sh" },
  19. //{ ".", "less" },
  20. };
  21. struct key bindings[] = {
  22. /* Quit */
  23. { 'q', SEL_QUIT, "\0", "\0" },
  24. /* Back */
  25. { KEY_BACKSPACE, SEL_BACK, "\0", "\0" },
  26. { KEY_LEFT, SEL_BACK, "\0", "\0" },
  27. { 'h', SEL_BACK, "\0", "\0" },
  28. { CONTROL('H'), SEL_BACK, "\0", "\0" },
  29. /* Inside */
  30. { KEY_ENTER, SEL_GOIN, "\0", "\0" },
  31. { '\r', SEL_GOIN, "\0", "\0" },
  32. { KEY_RIGHT, SEL_GOIN, "\0", "\0" },
  33. { 'l', SEL_GOIN, "\0", "\0" },
  34. /* Filter */
  35. { '/', SEL_FLTR, "\0", "\0" },
  36. { '&', SEL_FLTR, "\0", "\0" },
  37. /* Next */
  38. { 'j', SEL_NEXT, "\0", "\0" },
  39. { KEY_DOWN, SEL_NEXT, "\0", "\0" },
  40. { CONTROL('N'), SEL_NEXT, "\0", "\0" },
  41. /* Previous */
  42. { 'k', SEL_PREV, "\0", "\0" },
  43. { KEY_UP, SEL_PREV, "\0", "\0" },
  44. { CONTROL('P'), SEL_PREV, "\0", "\0" },
  45. /* Page down */
  46. { KEY_NPAGE, SEL_PGDN, "\0", "\0" },
  47. { CONTROL('D'), SEL_PGDN, "\0", "\0" },
  48. /* Page up */
  49. { KEY_PPAGE, SEL_PGUP, "\0", "\0" },
  50. { CONTROL('U'), SEL_PGUP, "\0", "\0" },
  51. /* Home */
  52. { KEY_HOME, SEL_HOME, "\0", "\0" },
  53. { CONTROL('A'), SEL_HOME, "\0", "\0" },
  54. { '^', SEL_HOME, "\0", "\0" },
  55. /* End */
  56. { KEY_END, SEL_END, "\0", "\0" },
  57. { CONTROL('E'), SEL_END, "\0", "\0" },
  58. { '$', SEL_END, "\0", "\0" },
  59. /* Change dir */
  60. { 'c', SEL_CD, "\0", "\0" },
  61. { '~', SEL_CDHOME, "\0", "\0" },
  62. /* Toggle hide .dot files */
  63. { '.', SEL_TOGGLEDOT, "\0", "\0" },
  64. /* Detailed listing */
  65. { 'd', SEL_DETAIL, "\0", "\0" },
  66. /* Toggle sort by size */
  67. { 's', SEL_FSIZE, "\0", "\0" },
  68. /* Toggle sort by time */
  69. { 't', SEL_MTIME, "\0", "\0" },
  70. { CONTROL('L'), SEL_REDRAW, "\0", "\0" },
  71. /* Copy currently selected file path */
  72. { CONTROL('K'), SEL_COPY, "\0", "\0" },
  73. /* Run command */
  74. { 'z', SEL_RUN, "top", "\0" },
  75. { '!', SEL_RUN, "sh", "SHELL" },
  76. /* Run command with argument */
  77. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  78. { 'p', SEL_RUNARG, "less", "PAGER" },
  79. };