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.
 
 
 
 
 
 

81 lignes
2.3 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 sizeorder = 0; /* Set to 1 to sort by file size */
  7. int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
  8. int showhidden = 0; /* Set to 1 to show hidden files by default */
  9. int showdetail = 0; /* Set to show additional file info */
  10. char *idlecmd = "rain"; /* The screensaver program */
  11. struct assoc assocs[] = {
  12. //{ "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", "mpv" },
  13. { "\\.(c|cpp|h|txt|log)$", "vim" },
  14. { "\\.(wma|mp3|ogg|flac)$", "fmedia" },
  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. { CONTROL('A'), SEL_HOME },
  54. { '^', SEL_HOME },
  55. /* End */
  56. { KEY_END, SEL_END },
  57. { CONTROL('E'), SEL_END },
  58. { '$', SEL_END },
  59. /* Change dir */
  60. { 'c', SEL_CD },
  61. { '~', SEL_CDHOME },
  62. /* Toggle hide .dot files */
  63. { '.', SEL_TOGGLEDOT },
  64. /* Detailed listing */
  65. { 'd', SEL_DETAIL },
  66. /* Toggle sort by size */
  67. { 's', SEL_FSIZE },
  68. /* Toggle sort by time */
  69. { 't', SEL_MTIME },
  70. { CONTROL('L'), SEL_REDRAW },
  71. /* Run command */
  72. { 'z', SEL_RUN, "top" },
  73. { '!', SEL_RUN, "sh", "SHELL" },
  74. /* Run command with argument */
  75. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  76. { 'p', SEL_RUNARG, "less", "PAGER" },
  77. };