My build of nnn with minor changes
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

73 lines
2.0 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. #define CWD "cwd: "
  3. #define CURSR " > "
  4. #define EMPTY " "
  5. int mtimeorder = 0; /* Set to 1 to sort by time modified */
  6. int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
  7. int showhidden = 0; /* Set to 1 to show hidden files by default */
  8. char *idlecmd = "rain"; /* The screensaver program */
  9. struct assoc assocs[] = {
  10. { "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", "mplayer" },
  11. { "\\.(png|jpg|gif)$", "feh" },
  12. { "\\.(html|svg)$", "firefox" },
  13. { "\\.pdf$", "mupdf" },
  14. { "\\.sh$", "sh" },
  15. { ".", "less" },
  16. };
  17. struct key bindings[] = {
  18. /* Quit */
  19. { 'q', SEL_QUIT },
  20. /* Back */
  21. { KEY_BACKSPACE, SEL_BACK },
  22. { KEY_LEFT, SEL_BACK },
  23. { 'h', SEL_BACK },
  24. { CONTROL('H'), SEL_BACK },
  25. /* Inside */
  26. { KEY_ENTER, SEL_GOIN },
  27. { '\r', SEL_GOIN },
  28. { KEY_RIGHT, SEL_GOIN },
  29. { 'l', SEL_GOIN },
  30. /* Filter */
  31. { '/', SEL_FLTR },
  32. { '&', SEL_FLTR },
  33. /* Next */
  34. { 'j', SEL_NEXT },
  35. { KEY_DOWN, SEL_NEXT },
  36. { CONTROL('N'), SEL_NEXT },
  37. /* Previous */
  38. { 'k', SEL_PREV },
  39. { KEY_UP, SEL_PREV },
  40. { CONTROL('P'), SEL_PREV },
  41. /* Page down */
  42. { KEY_NPAGE, SEL_PGDN },
  43. { CONTROL('D'), SEL_PGDN },
  44. /* Page up */
  45. { KEY_PPAGE, SEL_PGUP },
  46. { CONTROL('U'), SEL_PGUP },
  47. /* Home */
  48. { KEY_HOME, SEL_HOME },
  49. { CONTROL('A'), SEL_HOME },
  50. { '^', SEL_HOME },
  51. /* End */
  52. { KEY_END, SEL_END },
  53. { CONTROL('E'), SEL_END },
  54. { '$', SEL_END },
  55. /* Change dir */
  56. { 'c', SEL_CD },
  57. { '~', SEL_CDHOME },
  58. /* Toggle hide .dot files */
  59. { '.', SEL_TOGGLEDOT },
  60. /* Toggle sort by time */
  61. { 't', SEL_MTIME },
  62. { CONTROL('L'), SEL_REDRAW },
  63. /* Run command */
  64. { 'z', SEL_RUN, "top" },
  65. { '!', SEL_RUN, "sh", "SHELL" },
  66. /* Run command with argument */
  67. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  68. { 'p', SEL_RUNARG, "less", "PAGER" },
  69. };