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.
 
 
 
 
 
 

59 lines
1.5 KiB

  1. #define CWD "cwd: "
  2. #define CURSR " > "
  3. #define EMPTY " "
  4. int mtimeorder = 0; /* Set to 1 to sort by time in the default case */
  5. struct assoc assocs[] = {
  6. { "\\.(avi|mp4|mkv|mp3|ogg|flac)$", "mplayer" },
  7. { "\\.(png|jpg|gif)$", "feh" },
  8. { "\\.(html|svg)$", "firefox" },
  9. { "\\.pdf$", "mupdf" },
  10. { "\\.sh$", "sh" },
  11. { ".", "less" },
  12. };
  13. struct key bindings[] = {
  14. /* Quit */
  15. { 'q', SEL_QUIT },
  16. /* Back */
  17. { KEY_BACKSPACE, SEL_BACK },
  18. { KEY_LEFT, SEL_BACK },
  19. { 'h', SEL_BACK },
  20. { CONTROL('H'), SEL_BACK },
  21. /* Inside */
  22. { KEY_ENTER, SEL_GOIN },
  23. { '\r', SEL_GOIN },
  24. { KEY_RIGHT, SEL_GOIN },
  25. { 'l', SEL_GOIN },
  26. /* Filter */
  27. { '/', SEL_FLTR },
  28. { '&', SEL_FLTR },
  29. /* Filter as you type */
  30. { '?', SEL_TYPE },
  31. /* Next */
  32. { 'j', SEL_NEXT },
  33. { KEY_DOWN, SEL_NEXT },
  34. { CONTROL('N'), SEL_NEXT },
  35. /* Previous */
  36. { 'k', SEL_PREV },
  37. { KEY_UP, SEL_PREV },
  38. { CONTROL('P'), SEL_PREV },
  39. /* Page down */
  40. { KEY_NPAGE, SEL_PGDN },
  41. { CONTROL('D'), SEL_PGDN },
  42. /* Page up */
  43. { KEY_PPAGE, SEL_PGUP },
  44. { CONTROL('U'), SEL_PGUP },
  45. /* Change dir */
  46. { 'c', SEL_CD },
  47. /* Toggle sort by time */
  48. { 't', SEL_MTIME },
  49. { CONTROL('L'), SEL_REDRAW },
  50. /* Run command */
  51. { '!', SEL_RUN, "sh" },
  52. { 'z', SEL_RUN, "top" },
  53. /* Run command with argument */
  54. { 'e', SEL_RUNARG, "vi" },
  55. };