My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

71 lignes
1.9 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 in the default case */
  6. int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
  7. char *idlecmd = "rain"; /* The screensaver program */
  8. struct assoc assocs[] = {
  9. { "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", "mplayer" },
  10. { "\\.(png|jpg|gif)$", "feh" },
  11. { "\\.(html|svg)$", "firefox" },
  12. { "\\.pdf$", "mupdf" },
  13. { "\\.sh$", "sh" },
  14. { ".", "less" },
  15. };
  16. struct key bindings[] = {
  17. /* Quit */
  18. { 'q', SEL_QUIT },
  19. /* Back */
  20. { KEY_BACKSPACE, SEL_BACK },
  21. { KEY_LEFT, SEL_BACK },
  22. { 'h', SEL_BACK },
  23. { CONTROL('H'), SEL_BACK },
  24. /* Inside */
  25. { KEY_ENTER, SEL_GOIN },
  26. { '\r', SEL_GOIN },
  27. { KEY_RIGHT, SEL_GOIN },
  28. { 'l', SEL_GOIN },
  29. /* Filter */
  30. { '/', SEL_FLTR },
  31. { '&', SEL_FLTR },
  32. /* Filter as you type */
  33. { '?', SEL_TYPE },
  34. /* Next */
  35. { 'j', SEL_NEXT },
  36. { KEY_DOWN, SEL_NEXT },
  37. { CONTROL('N'), SEL_NEXT },
  38. /* Previous */
  39. { 'k', SEL_PREV },
  40. { KEY_UP, SEL_PREV },
  41. { CONTROL('P'), SEL_PREV },
  42. /* Page down */
  43. { KEY_NPAGE, SEL_PGDN },
  44. { CONTROL('D'), SEL_PGDN },
  45. /* Page up */
  46. { KEY_PPAGE, SEL_PGUP },
  47. { CONTROL('U'), SEL_PGUP },
  48. /* Home */
  49. { KEY_HOME, SEL_HOME },
  50. { CONTROL('A'), SEL_HOME },
  51. { '^', SEL_HOME },
  52. /* End */
  53. { KEY_END, SEL_END },
  54. { CONTROL('E'), SEL_END },
  55. { '$', SEL_END },
  56. /* Change dir */
  57. { 'c', SEL_CD },
  58. /* Toggle sort by time */
  59. { 't', SEL_MTIME },
  60. { CONTROL('L'), SEL_REDRAW },
  61. /* Run command */
  62. { 'z', SEL_RUN, "top" },
  63. { '!', SEL_RUN, "sh", "SHELL" },
  64. /* Run command with argument */
  65. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  66. { 'p', SEL_RUNARG, "less", "PAGER" },
  67. };