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

105 行
4.1 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. #define CWD "cwd: "
  3. #define CURSR " > "
  4. #define EMPTY " "
  5. static int filtermode = 0; /* Set to 1 to enter filter mode */
  6. static int mtimeorder = 0; /* Set to 1 to sort by time modified */
  7. static int sizeorder = 0; /* Set to 1 to sort by file size */
  8. static int bsizeorder = 0; /* Set to 1 to sort by blocks used including content */
  9. static int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
  10. static int showhidden = 0; /* Set to 1 to show hidden files by default */
  11. static int showdetail = 0; /* Set to show additional file info */
  12. static struct assoc assocs[] = {
  13. { "\\.(c|cpp|h|log|md|py|sh|txt)$", "text" },
  14. { "\\.(3g2|3gp|asf|avi|divx|flv|m2v|m4v|mkv|mov|mp4|mp4v|mpeg|mpg|ogv|qt|rm|rmvb|vob|webm|wmv)$", "video" },
  15. { "\\.(aac|ac3|amr|flac|m4a|m4b|m4p|mp3|mp4a|ogg|opus|ra|wav|wma)$", "audio" },
  16. { "\\.(bmp|gif|jpeg|jpg|pbm|pgm|png|svg|tiff|webp)$", "image" },
  17. { "\\.pdf$", "pdf" },
  18. };
  19. static struct key bindings[] = {
  20. /* Quit */
  21. { 'q', SEL_QUIT, "", "" },
  22. { CONTROL('Q'), SEL_QUIT, "", "" },
  23. /* Change dir on quit */
  24. { 'Q', SEL_CDQUIT, "", "" },
  25. /* Back */
  26. { KEY_BACKSPACE, SEL_BACK, "", "" },
  27. { KEY_LEFT, SEL_BACK, "", "" },
  28. { 'h', SEL_BACK, "", "" },
  29. { CONTROL('H'), SEL_BACK, "", "" },
  30. /* Inside */
  31. { KEY_ENTER, SEL_GOIN, "", "" },
  32. { '\r', SEL_GOIN, "", "" },
  33. { KEY_RIGHT, SEL_GOIN, "", "" },
  34. { 'l', SEL_GOIN, "", "" },
  35. /* Filter */
  36. { '/', SEL_FLTR, "", "" },
  37. /* Toggle filter mode */
  38. { KEY_IC, SEL_MFLTR, "", "" },
  39. /* Desktop search */
  40. { CONTROL('_'), SEL_SEARCH, "", "" },
  41. /* Next */
  42. { 'j', SEL_NEXT, "", "" },
  43. { KEY_DOWN, SEL_NEXT, "", "" },
  44. { CONTROL('N'), SEL_NEXT, "", "" },
  45. /* Previous */
  46. { 'k', SEL_PREV, "", "" },
  47. { KEY_UP, SEL_PREV, "", "" },
  48. { CONTROL('P'), SEL_PREV, "", "" },
  49. /* Page down */
  50. { KEY_NPAGE, SEL_PGDN, "", "" },
  51. { CONTROL('D'), SEL_PGDN, "", "" },
  52. /* Page up */
  53. { KEY_PPAGE, SEL_PGUP, "", "" },
  54. { CONTROL('U'), SEL_PGUP, "", "" },
  55. /* First entry */
  56. { KEY_HOME, SEL_HOME, "", "" },
  57. { 'g', SEL_HOME, "", "" },
  58. { CONTROL('A'), SEL_HOME, "", "" },
  59. { '^', SEL_HOME, "", "" },
  60. /* Last entry */
  61. { KEY_END, SEL_END, "", "" },
  62. { 'G', SEL_END, "", "" },
  63. { CONTROL('E'), SEL_END, "", "" },
  64. { '$', SEL_END, "", "" },
  65. /* Change dir */
  66. { 'c', SEL_CD, "", "" },
  67. /* HOME */
  68. { '~', SEL_CDHOME, "", "" },
  69. /* Initial directory */
  70. { '&', SEL_CDBEGIN, "", "" },
  71. /* Last visited dir */
  72. { '-', SEL_CDLAST, "", "" },
  73. /* Toggle hide .dot files */
  74. { '.', SEL_TOGGLEDOT, "", "" },
  75. /* Detailed listing */
  76. { 'd', SEL_DETAIL, "", "" },
  77. /* File details */
  78. { 'D', SEL_STATS, "", "" },
  79. /* Show mediainfo short */
  80. { 'm', SEL_MEDIA, "", "" },
  81. /* Show mediainfo full */
  82. { 'M', SEL_FMEDIA, "", "" },
  83. /* Open dir in desktop file manager */
  84. { 'o', SEL_DFB, "", "" },
  85. /* Toggle sort by size */
  86. { 's', SEL_FSIZE, "", "" },
  87. /* Sort by total block size including dir contents */
  88. { 'S', SEL_BSIZE, "", "" },
  89. /* Toggle sort by time */
  90. { 't', SEL_MTIME, "", "" },
  91. { CONTROL('L'), SEL_REDRAW, "", "" },
  92. /* Copy currently selected file path */
  93. { CONTROL('K'), SEL_COPY, "", "" },
  94. /* Show help */
  95. { '?', SEL_HELP, "", "" },
  96. /* Run command */
  97. { '!', SEL_RUN, "sh", "SHELL" },
  98. /* Run command with argument */
  99. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  100. { 'p', SEL_RUNARG, "less", "PAGER" },
  101. };