My build of nnn with minor changes
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

102 řádky
3.8 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. struct assoc assocs[] = {
  13. { "\\.(c|cpp|h|txt|log|sh)$", "vi" },
  14. { "\\.(avi|mp4|mkv|3gp|mov)$", "mpv" },
  15. { "\\.(wma|mp3|ogg|flac|m4a)$", "mpv" },
  16. { "\\.(png|jpg|gif)$", "viewnior" },
  17. //{ "\\.(html|svg)$", "firefox" },
  18. { "\\.pdf$", "zathura" },
  19. //{ "\\.sh$", "sh" },
  20. //{ ".", "less" },
  21. };
  22. struct key bindings[] = {
  23. /* Quit */
  24. { 'q', SEL_QUIT, "", "" },
  25. { 'Q', SEL_CDQUIT, "", "" },
  26. /* Back */
  27. { KEY_BACKSPACE, SEL_BACK, "", "" },
  28. { KEY_LEFT, SEL_BACK, "", "" },
  29. { 'h', SEL_BACK, "", "" },
  30. { CONTROL('H'), SEL_BACK, "", "" },
  31. /* Inside */
  32. { KEY_ENTER, SEL_GOIN, "", "" },
  33. { '\r', SEL_GOIN, "", "" },
  34. { KEY_RIGHT, SEL_GOIN, "", "" },
  35. { 'l', SEL_GOIN, "", "" },
  36. /* Filter */
  37. { '/', SEL_FLTR, "", "" },
  38. { '&', SEL_FLTR, "", "" },
  39. /* Next */
  40. { 'j', SEL_NEXT, "", "" },
  41. { KEY_DOWN, SEL_NEXT, "", "" },
  42. { CONTROL('N'), SEL_NEXT, "", "" },
  43. /* Previous */
  44. { 'k', SEL_PREV, "", "" },
  45. { KEY_UP, SEL_PREV, "", "" },
  46. { CONTROL('P'), SEL_PREV, "", "" },
  47. /* Page down */
  48. { KEY_NPAGE, SEL_PGDN, "", "" },
  49. { CONTROL('D'), SEL_PGDN, "", "" },
  50. /* Page up */
  51. { KEY_PPAGE, SEL_PGUP, "", "" },
  52. { CONTROL('U'), SEL_PGUP, "", "" },
  53. /* Home */
  54. { KEY_HOME, SEL_HOME, "", "" },
  55. { 'g', SEL_HOME, "", "" },
  56. { CONTROL('A'), SEL_HOME, "", "" },
  57. { '^', SEL_HOME, "", "" },
  58. /* End */
  59. { KEY_END, SEL_END, "", "" },
  60. { 'G', SEL_END, "", "" },
  61. { CONTROL('E'), SEL_END, "", "" },
  62. { '$', SEL_END, "", "" },
  63. /* Change dir */
  64. { 'c', SEL_CD, "", "" },
  65. /* HOME */
  66. { '~', SEL_CDHOME, "", "" },
  67. /* Last visited dir */
  68. { '-', SEL_LAST, "", "" },
  69. /* Toggle hide .dot files */
  70. { '.', SEL_TOGGLEDOT, "", "" },
  71. /* Detailed listing */
  72. { 'd', SEL_DETAIL, "", "" },
  73. /* File details */
  74. { 'D', SEL_STATS, "", "" },
  75. /* Show mediainfo short */
  76. { 'm', SEL_MEDIA, "", "" },
  77. /* Show mediainfo full */
  78. { 'M', SEL_FMEDIA, "", "" },
  79. /* Open dir in desktop file manager */
  80. { 'o', SEL_DFB, "", "" },
  81. /* Toggle sort by size */
  82. { 's', SEL_FSIZE, "", "" },
  83. /* Sort by total block size including dir contents */
  84. { 'S', SEL_BSIZE, "", "" },
  85. /* Toggle sort by time */
  86. { 't', SEL_MTIME, "", "" },
  87. { CONTROL('L'), SEL_REDRAW, "", "" },
  88. /* Copy currently selected file path */
  89. { CONTROL('K'), SEL_COPY, "", "" },
  90. /* Show help */
  91. { '?', SEL_HELP, "", "" },
  92. /* Run command */
  93. { 'z', SEL_RUN, "top", "" },
  94. { '!', SEL_RUN, "sh", "SHELL" },
  95. /* Run command with argument */
  96. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  97. { 'p', SEL_RUNARG, "less", "PAGER" },
  98. };