My build of nnn with minor changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

89 lines
3.3 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. { "\\.(c|cpp|h|txt|log|sh)$", "vi" },
  13. //{ "\\.(avi|mp4|mkv|3gp|mov)$", "mpv" },
  14. { "\\.(wma|mp3|ogg|flac|m4a)$", "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, "", "" },
  24. /* Back */
  25. { KEY_BACKSPACE, SEL_BACK, "", "" },
  26. { KEY_LEFT, SEL_BACK, "", "" },
  27. { 'h', SEL_BACK, "", "" },
  28. { CONTROL('H'), SEL_BACK, "", "" },
  29. /* Inside */
  30. { KEY_ENTER, SEL_GOIN, "", "" },
  31. { '\r', SEL_GOIN, "", "" },
  32. { KEY_RIGHT, SEL_GOIN, "", "" },
  33. { 'l', SEL_GOIN, "", "" },
  34. /* Filter */
  35. { '/', SEL_FLTR, "", "" },
  36. { '&', SEL_FLTR, "", "" },
  37. /* Next */
  38. { 'j', SEL_NEXT, "", "" },
  39. { KEY_DOWN, SEL_NEXT, "", "" },
  40. { CONTROL('N'), SEL_NEXT, "", "" },
  41. /* Previous */
  42. { 'k', SEL_PREV, "", "" },
  43. { KEY_UP, SEL_PREV, "", "" },
  44. { CONTROL('P'), SEL_PREV, "", "" },
  45. /* Page down */
  46. { KEY_NPAGE, SEL_PGDN, "", "" },
  47. { CONTROL('D'), SEL_PGDN, "", "" },
  48. /* Page up */
  49. { KEY_PPAGE, SEL_PGUP, "", "" },
  50. { CONTROL('U'), SEL_PGUP, "", "" },
  51. /* Home */
  52. { KEY_HOME, SEL_HOME, "", "" },
  53. { 'g', SEL_HOME, "", "" },
  54. { CONTROL('A'), SEL_HOME, "", "" },
  55. { '^', SEL_HOME, "", "" },
  56. /* End */
  57. { KEY_END, SEL_END, "", "" },
  58. { 'G', SEL_END, "", "" },
  59. { CONTROL('E'), SEL_END, "", "" },
  60. { '$', SEL_END, "", "" },
  61. /* Change dir */
  62. { 'c', SEL_CD, "", "" },
  63. { '~', SEL_CDHOME, "", "" },
  64. /* Toggle hide .dot files */
  65. { '.', SEL_TOGGLEDOT, "", "" },
  66. /* Detailed listing */
  67. { 'd', SEL_DETAIL, "", "" },
  68. /* File details */
  69. { 'D', SEL_STATS, "", "" },
  70. /* Toggle sort by size */
  71. { 's', SEL_FSIZE, "", "" },
  72. /* Toggle sort by time */
  73. { 't', SEL_MTIME, "", "" },
  74. { CONTROL('L'), SEL_REDRAW, "", "" },
  75. /* Copy currently selected file path */
  76. { CONTROL('K'), SEL_COPY, "", "" },
  77. /* Show help */
  78. { '?', SEL_HELP, "", "" },
  79. /* Run command */
  80. { 'z', SEL_RUN, "top", "" },
  81. { '!', SEL_RUN, "sh", "SHELL" },
  82. /* Run command with argument */
  83. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  84. { 'p', SEL_RUNARG, "less", "PAGER" },
  85. };