My build of nnn with minor changes
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 lines
2.1 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)$", "mpv" },
  11. { "\\.(c|cpp|h|txt|log)$", "vim" },
  12. { "\\.(wma|mp3|ogg|flac)$", "fmedia" },
  13. //{ "\\.(png|jpg|gif)$", "feh" },
  14. //{ "\\.(html|svg)$", "firefox" },
  15. { "\\.pdf$", "zathura" },
  16. { "\\.sh$", "sh" },
  17. //{ ".", "less" },
  18. };
  19. struct key bindings[] = {
  20. /* Quit */
  21. { 'q', SEL_QUIT },
  22. /* Back */
  23. { KEY_BACKSPACE, SEL_BACK },
  24. { KEY_LEFT, SEL_BACK },
  25. { 'h', SEL_BACK },
  26. { CONTROL('H'), SEL_BACK },
  27. /* Inside */
  28. { KEY_ENTER, SEL_GOIN },
  29. { '\r', SEL_GOIN },
  30. { KEY_RIGHT, SEL_GOIN },
  31. { 'l', SEL_GOIN },
  32. /* Filter */
  33. { '/', SEL_FLTR },
  34. { '&', SEL_FLTR },
  35. /* Next */
  36. { 'j', SEL_NEXT },
  37. { KEY_DOWN, SEL_NEXT },
  38. { CONTROL('N'), SEL_NEXT },
  39. /* Previous */
  40. { 'k', SEL_PREV },
  41. { KEY_UP, SEL_PREV },
  42. { CONTROL('P'), SEL_PREV },
  43. /* Page down */
  44. { KEY_NPAGE, SEL_PGDN },
  45. { CONTROL('D'), SEL_PGDN },
  46. /* Page up */
  47. { KEY_PPAGE, SEL_PGUP },
  48. { CONTROL('U'), SEL_PGUP },
  49. /* Home */
  50. { KEY_HOME, SEL_HOME },
  51. { CONTROL('A'), SEL_HOME },
  52. { '^', SEL_HOME },
  53. /* End */
  54. { KEY_END, SEL_END },
  55. { CONTROL('E'), SEL_END },
  56. { '$', SEL_END },
  57. /* Change dir */
  58. { 'c', SEL_CD },
  59. { '~', SEL_CDHOME },
  60. /* Toggle hide .dot files */
  61. { '.', SEL_TOGGLEDOT },
  62. /* Toggle sort by time */
  63. { 't', SEL_MTIME },
  64. { CONTROL('L'), SEL_REDRAW },
  65. /* Run command */
  66. { 'z', SEL_RUN, "top" },
  67. { '!', SEL_RUN, "sh", "SHELL" },
  68. /* Run command with argument */
  69. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  70. { 'p', SEL_RUNARG, "less", "PAGER" },
  71. };