My build of nnn with minor changes
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

103 líneas
3.9 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. #define CWD "cwd: "
  3. #define CURSR " > "
  4. #define EMPTY " "
  5. static int filtermode; /* Set to 1 to enter filter mode */
  6. static int mtimeorder; /* Set to 1 to sort by time modified */
  7. static int sizeorder; /* Set to 1 to sort by file size */
  8. static int bsizeorder; /* Set to 1 to sort by blocks used (disk usage) */
  9. static int idletimeout; /* Idle timeout in seconds, 0 to disable */
  10. static int showhidden; /* Set to 1 to show hidden files by default */
  11. static int showdetail = 1; /* Set to 0 to show fewer file info */
  12. static struct assoc assocs[] = {
  13. { "\\.(c|cpp|h|log|md|py|sh|txt)$", "text" },
  14. };
  15. static struct key bindings[] = {
  16. /* Quit */
  17. { 'q', SEL_QUIT, "", "" },
  18. { CONTROL('Q'), SEL_QUIT, "", "" },
  19. /* Change dir on quit */
  20. { 'Q', SEL_CDQUIT, "", "" },
  21. /* Back */
  22. { KEY_BACKSPACE, SEL_BACK, "", "" },
  23. { KEY_LEFT, SEL_BACK, "", "" },
  24. { 'h', SEL_BACK, "", "" },
  25. { CONTROL('H'), SEL_BACK, "", "" },
  26. /* Inside */
  27. { KEY_ENTER, SEL_GOIN, "", "" },
  28. { '\r', SEL_GOIN, "", "" },
  29. { KEY_RIGHT, SEL_GOIN, "", "" },
  30. { 'l', SEL_GOIN, "", "" },
  31. /* Filter */
  32. { '/', SEL_FLTR, "", "" },
  33. /* Toggle filter mode */
  34. { KEY_IC, SEL_MFLTR, "", "" },
  35. /* Desktop search */
  36. { CONTROL('_'), SEL_SEARCH, "", "" },
  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. /* First entry */
  52. { KEY_HOME, SEL_HOME, "", "" },
  53. { 'g', SEL_HOME, "", "" },
  54. { CONTROL('A'), SEL_HOME, "", "" },
  55. { '^', SEL_HOME, "", "" },
  56. /* Last entry */
  57. { KEY_END, SEL_END, "", "" },
  58. { 'G', SEL_END, "", "" },
  59. { CONTROL('E'), SEL_END, "", "" },
  60. { '$', SEL_END, "", "" },
  61. /* Change dir */
  62. { 'c', SEL_CD, "", "" },
  63. /* HOME */
  64. { '~', SEL_CDHOME, "", "" },
  65. /* Initial directory */
  66. { '&', SEL_CDBEGIN, "", "" },
  67. /* Last visited dir */
  68. { '-', SEL_CDLAST, "", "" },
  69. /* Change dir using bookmark */
  70. { 'b', SEL_CDBM, "", "" },
  71. /* Toggle hide .dot files */
  72. { '.', SEL_TOGGLEDOT, "", "" },
  73. /* Detailed listing */
  74. { 'd', SEL_DETAIL, "", "" },
  75. /* File details */
  76. { 'D', SEL_STATS, "", "" },
  77. /* Show mediainfo short */
  78. { 'm', SEL_MEDIA, "", "" },
  79. /* Show mediainfo full */
  80. { 'M', SEL_FMEDIA, "", "" },
  81. /* Open dir in desktop file manager */
  82. { 'o', SEL_DFB, "", "" },
  83. /* Toggle sort by size */
  84. { 's', SEL_FSIZE, "", "" },
  85. /* Sort by total block size including dir contents */
  86. { 'S', SEL_BSIZE, "", "" },
  87. /* Toggle sort by time */
  88. { 't', SEL_MTIME, "", "" },
  89. { CONTROL('L'), SEL_REDRAW, "", "" },
  90. /* Copy currently selected file path */
  91. { CONTROL('K'), SEL_COPY, "", "" },
  92. /* Show help */
  93. { '?', SEL_HELP, "", "" },
  94. /* Run command */
  95. { '!', SEL_RUN, "sh", "SHELL" },
  96. /* Run command with argument */
  97. { 'e', SEL_RUNARG, "vi", "EDITOR" },
  98. { 'p', SEL_RUNARG, "less", "PAGER" },
  99. };