My build of nnn with minor changes
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

97 wiersze
3.6 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. /* 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. { '&', SEL_FLTR, "", "" },
  38. /* Next */
  39. { 'j', SEL_NEXT, "", "" },
  40. { KEY_DOWN, SEL_NEXT, "", "" },
  41. { CONTROL('N'), SEL_NEXT, "", "" },
  42. /* Previous */
  43. { 'k', SEL_PREV, "", "" },
  44. { KEY_UP, SEL_PREV, "", "" },
  45. { CONTROL('P'), SEL_PREV, "", "" },
  46. /* Page down */
  47. { KEY_NPAGE, SEL_PGDN, "", "" },
  48. { CONTROL('D'), SEL_PGDN, "", "" },
  49. /* Page up */
  50. { KEY_PPAGE, SEL_PGUP, "", "" },
  51. { CONTROL('U'), SEL_PGUP, "", "" },
  52. /* Home */
  53. { KEY_HOME, SEL_HOME, "", "" },
  54. { 'g', SEL_HOME, "", "" },
  55. { CONTROL('A'), SEL_HOME, "", "" },
  56. { '^', SEL_HOME, "", "" },
  57. /* End */
  58. { KEY_END, SEL_END, "", "" },
  59. { 'G', SEL_END, "", "" },
  60. { CONTROL('E'), SEL_END, "", "" },
  61. { '$', SEL_END, "", "" },
  62. /* Change dir */
  63. { 'c', SEL_CD, "", "" },
  64. /* HOME */
  65. { '~', SEL_CDHOME, "", "" },
  66. /* Last visited dir */
  67. { '-', SEL_LAST, "", "" },
  68. /* Toggle hide .dot files */
  69. { '.', SEL_TOGGLEDOT, "", "" },
  70. /* Detailed listing */
  71. { 'd', SEL_DETAIL, "", "" },
  72. /* File details */
  73. { 'D', SEL_STATS, "", "" },
  74. /* Open dir in desktop file manager */
  75. { 'o', SEL_DFB, "", "" },
  76. /* Toggle sort by size */
  77. { 's', SEL_FSIZE, "", "" },
  78. /* Sort by total block size including dir contents */
  79. { 'S', SEL_BSIZE, "", "" },
  80. /* Toggle sort by time */
  81. { 't', SEL_MTIME, "", "" },
  82. { CONTROL('L'), SEL_REDRAW, "", "" },
  83. /* Copy currently selected file path */
  84. { CONTROL('K'), SEL_COPY, "", "" },
  85. /* Show help */
  86. { '?', SEL_HELP, "", "" },
  87. /* Run command */
  88. { 'z', SEL_RUN, "top", "" },
  89. { '!', SEL_RUN, "sh", "SHELL" },
  90. /* Run command with argument */
  91. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  92. { 'p', SEL_RUNARG, "less", "PAGER" },
  93. };