My build of nnn with minor changes
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. ## nnn
  2. Noice is Not Noice, a noicer fork...
  3. <br>
  4. [![nnn-demo-20170405.mp4](https://i.imgur.com/VGA6IcB.png)](https://static.zhimingwang.org/nnn-demo-20170405.mp4 "Click for some action!")
  5. <p align="center"><a href="https://static.zhimingwang.org/nnn-demo-20170405.mp4">Click for some action!</a></p>
  6. ### Table of Contents
  7. - [Introduction](#introduction)
  8. - [Why fork?](#why-fork)
  9. - [Original features](#original-features)
  10. - [nnn toppings](#nnn-toppings)
  11. - [Installation](#installation)
  12. - [Usage](#usage)
  13. - [Keyboard shortcuts](#keyboard-shortcuts)
  14. - [Filters](#filters)
  15. - [File type abbreviations](#file-type-abbreviations)
  16. - [Help](#help)
  17. - [Copy current file path to clipboard](#copy-current-file-path-to-clipboard)
  18. - [Change file associations](#change-file-associations)
  19. ### Introduction
  20. nnn is a fork of [noice](http://git.2f30.org/noice/), a blazing-fast terminal file browser with easy keyboard shortcuts for navigation, opening files and running tasks. It is developed with terminal based systems in mind. However, the incredible user-friendliness and speed make it a perfect utility on modern distros.
  21. The only issue with noice is hard-coded file associations. There is no config file (better performance and simpler to maintain) and one has to modify the source to change associations (see [how to change file associations](#change-file-associations)). nnn solves the problem by adding the flexibility of using the default desktop opener at runtime. There are several other improvements too (see [fork-toppings](#fork-toppings)).
  22. You can try
  23. alias n='nnn -d'
  24. and see how nnn simplifies those long desktop sessions.
  25. Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/issues/1).
  26. ### Why fork?
  27. I chose to fork because:
  28. - one can argue my approach deviates from the goal of the original project - keep the utility `suckless`. In my opinion evolution is the taste of time.
  29. - I would like to have a bit of control on what features are added in the name of desktop integration. A feature-bloat is the last thing in my mind.
  30. ### Original features
  31. - Super-easy navigation
  32. - Open files with default-associated programs
  33. - Jump to home directory
  34. - Filter contents in current directory
  35. - Show/hide hidden files
  36. - Sort entries by modification time (newest to oldest)
  37. - Spawn a `SHELL` in current directory (fallback sh)
  38. - Run `top`
  39. - Edit a file with `EDITOR` (fallback vi)
  40. - Page through a file in `PAGER` (fallback less)
  41. ### nnn toppings
  42. - Behaviour and navigation
  43. - Detail view (default: disabled) with:
  44. - file type
  45. - modification time
  46. - human-readable file size
  47. - current item in reverse video
  48. - number of items in current directory
  49. - full name of currently selected file
  50. - Show details of the currently selected file (stat, file)
  51. - Directories first
  52. - Sort numeric names in numeric order
  53. - Case-insensitive alphabetic content listing instead of upper case first
  54. - Roll over at the first and last entries of a directory (with Up/Down keys)
  55. - Removed navigation restriction with relative paths (and let permissions handle it)
  56. - Sort entries by file size (largest to smallest)
  57. - Shortcut to invoke file name copier (set using environment variable `NNN_COPIER`)
  58. - File associations
  59. - Environment variable `NNN_OPENER` to let desktop opener handle it all. E.g.:
  60. export NNN_OPENER=xdg-open
  61. export NNN_OPENER=gnome-open
  62. export NNN_OPENER=gvfs-open
  63. - Selective file associations (ignored if `NNN_OPENER` is set):
  64. - Associate plain text files with vi (using `file` command)
  65. - Remove video file associations (to each his own favourite video player)
  66. - Associate common audio mimes with mpv
  67. - Associate PDF files with [zathura](https://pwmt.org/projects/zathura/)
  68. - Use environment variable `NNN_FALLBACK_OPENER` to open other non-associated files
  69. - Removed `less` as default file opener (there is no universal standalone opener utility)
  70. - Optimizations
  71. - Efficient memory usage, 0 malloc()
  72. - Complete redundant buffer removal
  73. - All frequently used local chunks now static
  74. - Removed some redundant string allocation and manipulation
  75. - Simplified some roundabout procedures
  76. - `-O3` level optimization, warning fixes
  77. - Added compilation flag `-march=native`
  78. - Remove generated config.h on `make clean`
  79. - strip the final binary
  80. ### Installation
  81. nnn needs a curses implementation and standard libc.
  82. Download the [latest master](https://github.com/jarun/nnn/archive/master.zip) or clone this repository. Compile and install:
  83. $ make
  84. $ sudo make install
  85. No plans of packaging at the time.
  86. ### Usage
  87. Start nnn (default: current directory):
  88. $ nnn [-d] [path_to_dir]
  89. -d: open in detail view mode
  90. `>` indicates the currently selected entry in nnn.
  91. ### Keyboard shortcuts
  92. | Key | Function |
  93. | --- | --- |
  94. | `Up`, `k`, `^P` | Previous entry |
  95. | `Down`, `j`, `^N` | Next entry |
  96. | `PgUp`, `^U` | Scroll half page up |
  97. | `PgDn`, `^D` | Scroll half page down |
  98. | `Home`, `g`, `^`, `^A` | Jump to first entry |
  99. | `End`, `G`, `$`, `^E` | Jump to last entry |
  100. | `Right`, `Enter`, `l`, `^M` | Open file or enter dir |
  101. | `Left`, `Backspace`, `h`, `^H` | Go to parent dir |
  102. | `~` | Jump to HOME dir |
  103. | `/`, `&` | Filter dir contents |
  104. | `c` | Show change dir prompt |
  105. | `d` | Toggle detail view |
  106. | `D` | Show details of selected file |
  107. | `.` | Toggle hide .dot files |
  108. | `s` | Toggle sort by file size |
  109. | `t` | Toggle sort by modified time |
  110. | `!` | Spawn `SHELL` in `PWD` (fallback sh) |
  111. | `z` | Run `top` |
  112. | `e` | Edit entry in `EDITOR` (fallback vi) |
  113. | `p` | Open entry in `PAGER` (fallback less) |
  114. | `^K` | Invoke file name copier |
  115. | `^L` | Force a redraw |
  116. | `?` | Show help |
  117. | `q` | Quit |
  118. ### Filters
  119. Filters support regexes to display only the matched entries in the current directory view. This effectively allows searching through the directory tree for a particular entry.
  120. Filters do not stack on top of each other. They are applied anew every time.
  121. An empty filter expression resets the filter.
  122. If nnn is invoked as root the default filter will also match hidden files.
  123. ### File type abbreviations
  124. The following abbreviations are used in the detail view:
  125. | Symbol | File Type |
  126. | --- | --- |
  127. | `/` | Directory |
  128. | `*` | Executable |
  129. | `|` | Fifo |
  130. | `=` | Socket |
  131. | `@` | Symbolic Link |
  132. | `b` | Block Device |
  133. | `c` | Character Device |
  134. ### Help
  135. $ man nnn
  136. ### Copy current file path to clipboard
  137. nnn can pipe the absolute path of the current file to a copier script. For example, you can use `xsel` on Linux or `pbcopy` on OS X.
  138. Sample Linux copier script:
  139. #!/bin/sh
  140. echo -n $1 | xsel --clipboard --input
  141. export `NNN_OPENER`:
  142. export NNN_COPIER="/home/vaio/copier.sh"
  143. Start nnn and use `Ctrl-k` to copy the absolute path (from `/`) of the file under the cursor to clipboard.
  144. ### Change file associations
  145. If you want to set custom applications for certain mime types, or change the ones set already (e.g. vi, mpv, zathura), modify the `assocs` structure in [config.def.h](https://github.com/jarun/nnn/blob/master/config.def.h) (it's easy). Then re-compile and install.