My build of nnn with minor changes
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

99 строки
3.9 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 bsizeorder = 0; /* Set to 1 to sort by blocks used including content */
  8. static int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
  9. static int showhidden = 0; /* Set to 1 to show hidden files by default */
  10. static int showdetail = 0; /* Set to show additional file info */
  11. static char *idlecmd = "rain"; /* The screensaver program */
  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. { 'Q', SEL_CDQUIT, "", "" },
  23. /* Back */
  24. { KEY_BACKSPACE, SEL_BACK, "", "" },
  25. { KEY_LEFT, SEL_BACK, "", "" },
  26. { 'h', SEL_BACK, "", "" },
  27. { CONTROL('H'), SEL_BACK, "", "" },
  28. /* Inside */
  29. { KEY_ENTER, SEL_GOIN, "", "" },
  30. { '\r', SEL_GOIN, "", "" },
  31. { KEY_RIGHT, SEL_GOIN, "", "" },
  32. { 'l', SEL_GOIN, "", "" },
  33. /* Filter */
  34. { '/', SEL_FLTR, "", "" },
  35. { '&', SEL_FLTR, "", "" },
  36. /* Next */
  37. { 'j', SEL_NEXT, "", "" },
  38. { KEY_DOWN, SEL_NEXT, "", "" },
  39. { CONTROL('N'), SEL_NEXT, "", "" },
  40. /* Previous */
  41. { 'k', SEL_PREV, "", "" },
  42. { KEY_UP, SEL_PREV, "", "" },
  43. { CONTROL('P'), SEL_PREV, "", "" },
  44. /* Page down */
  45. { KEY_NPAGE, SEL_PGDN, "", "" },
  46. { CONTROL('D'), SEL_PGDN, "", "" },
  47. /* Page up */
  48. { KEY_PPAGE, SEL_PGUP, "", "" },
  49. { CONTROL('U'), SEL_PGUP, "", "" },
  50. /* Home */
  51. { KEY_HOME, SEL_HOME, "", "" },
  52. { 'g', SEL_HOME, "", "" },
  53. { CONTROL('A'), SEL_HOME, "", "" },
  54. { '^', SEL_HOME, "", "" },
  55. /* End */
  56. { KEY_END, SEL_END, "", "" },
  57. { 'G', SEL_END, "", "" },
  58. { CONTROL('E'), SEL_END, "", "" },
  59. { '$', SEL_END, "", "" },
  60. /* Change dir */
  61. { 'c', SEL_CD, "", "" },
  62. /* HOME */
  63. { '~', SEL_CDHOME, "", "" },
  64. /* Last visited dir */
  65. { '-', SEL_LAST, "", "" },
  66. /* Toggle hide .dot files */
  67. { '.', SEL_TOGGLEDOT, "", "" },
  68. /* Detailed listing */
  69. { 'd', SEL_DETAIL, "", "" },
  70. /* File details */
  71. { 'D', SEL_STATS, "", "" },
  72. /* Show mediainfo short */
  73. { 'm', SEL_MEDIA, "", "" },
  74. /* Show mediainfo full */
  75. { 'M', SEL_FMEDIA, "", "" },
  76. /* Open dir in desktop file manager */
  77. { 'o', SEL_DFB, "", "" },
  78. /* Toggle sort by size */
  79. { 's', SEL_FSIZE, "", "" },
  80. /* Sort by total block size including dir contents */
  81. { 'S', SEL_BSIZE, "", "" },
  82. /* Toggle sort by time */
  83. { 't', SEL_MTIME, "", "" },
  84. { CONTROL('L'), SEL_REDRAW, "", "" },
  85. /* Copy currently selected file path */
  86. { CONTROL('K'), SEL_COPY, "", "" },
  87. /* Show help */
  88. { '?', SEL_HELP, "", "" },
  89. /* Run command */
  90. { 'z', SEL_RUN, "top", "" },
  91. { '!', SEL_RUN, "sh", "SHELL" },
  92. /* Run command with argument */
  93. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  94. { 'p', SEL_RUNARG, "less", "PAGER" },
  95. };