My build of nnn with minor changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
преди 5 години
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. To extend the capabilities of `nnn`, plugins are introduced. Plugins are scripts which `nnn` can communicate with and trigger. This mechanism fits perfectly with the fundamental design to keep the core file manager lean and fast, by delegating repetitive (but not necessarily file manager-specific) tasks to the plugins.
  2. The currently available plugins are listed below.
  3. | Plugin (a-z) | Lang | Deps | Description |
  4. | --- | --- | --- | --- |
  5. | boom | sh | [moc](http://moc.daper.net/) | Play random music from dir |
  6. | dups | sh | find, md5sum,<br>sort uniq xargs | List non-empty duplicate files in current dir |
  7. | checksum | sh | md5sum,<br>sha256sum | Create and verify checksums |
  8. | fzy-open | sh | fzy, xdg-open | Fuzzy find a file in dir subtree and edit or xdg-open |
  9. | getplugs | sh | wget | Update plugins |
  10. | hexview | sh | xxd | View a file in hex in `$PAGER` |
  11. | imgresize | sh | [imgp](https://github.com/jarun/imgp) | Resize images in dir to screen resolution |
  12. | imgur | bash | - | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) |
  13. | ipinfo | sh | curl, whois | Fetch external IP address and whois information |
  14. | kdeconnect | sh | kdeconnect-cli | Send selected files to an Android device |
  15. | mediainf | sh | mediainfo | Show media information |
  16. | moclyrics | sh | [ddgr](https://github.com/jarun/ddgr), [moc](http://moc.daper.net/) | Show lyrics of the track playing in moc |
  17. | mocplay | sh | [moc](http://moc.daper.net/) | Appends (and plays, see script) selection/dir/file in moc|
  18. | ndiff | sh | vimdiff | Diff for selection (limited to 2 for directories) |
  19. | nmount | sh | pmount, udisks2 | Toggle mount status of a device as normal user |
  20. | nwal | sh | nitrogen | Set image as wallpaper using nitrogen |
  21. | oldbigfile | sh | find, sort | List large files by access time |
  22. | organize | sh | file | Auto-organize files in directories by file type |
  23. | pastebin | sh | [pastebinit](https://launchpad.net/pastebinit) | Paste contents of (text) file to paste.ubuntu.com |
  24. | pdfview | sh | pdftotext/<br>mupdf-tools | View PDF file in `$PAGER` |
  25. | picker | sh | nnn | Pick files and list one per line (to pipe) |
  26. | pywal | sh | pywal | Set image as wallpaper, change terminal colorscheme |
  27. | readit | sh | pdftotext, mpv,<br>pico2wave | Read a PDF or text file aloud |
  28. | ringtone | sh | date, ffmpeg | Create a variable bitrate mp3 ringtone from file |
  29. | splitjoin | sh | split, cat | Split file or join selection |
  30. | sxiv | sh | sxiv | View images in dir, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts))|
  31. | thumb | sh | [lsix](https://github.com/hackerb9/lsix) | View thumbnail of an image or dir of images |
  32. | transfer | sh | curl | Upload file to transfer.sh |
  33. | upgrade | sh | wget | Upgrade nnn manually on Debian 9 Stretch |
  34. | vidthumb | sh | [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer),<br>[lsix](https://github.com/hackerb9/lsix) | Show video thumbnails in terminal |
  35. | viuimg | sh | [viu](https://github.com/atanunq/viu), less | View an image or images in dir |
  36. ## Installing plugins
  37. Download the `getplugs` plugin and execute it anywhere to get all the plugins installed to `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`. You can run it again later to update the plugins. It backs up earlier plugins.
  38. **NOTE:** `getplugs` also downloads the launcher `nlaunch` and tries to place it at `/usr/local/bin/` using `sudo`. If it fails you have to place `nlauch` manually somewhere in your `$PATH`.
  39. ## File access from plugins
  40. Plugins can access:
  41. - all files in the directory (`nnn` switches to the dir where the plugin is to be run so the dir is `$PWD` for the plugin)
  42. - the current file under the cursor (the file name is passed as the argument to a plugin)
  43. - the current selection (by reading the file `.selection` in config dir, see the plugin `ndiff`)
  44. Each script has a _Description_ section which provides more details on what the script does, if applicable.
  45. ## Usage
  46. There are 2 ways to run plugins:
  47. 1. Directly with <kbd>x-key</kbd>:
  48. export NNN_PLUG='o:fzy-open;p:mocplay;d:ndiff;m:nmount;t:thumb'
  49. With this, plugin `fzy-open` can be run with the keybind <kbd>xo</kbd>, `mocplay` can be run with <kbd>xp</kbd> and so on... The key vs. plugin pairs are shown in the help and config screen. Up to 10 plugins can have such keybinds.
  50. 2. Use the _pick plugin_ shortcut to visit the plugin directory and execute a plugin. Repeating the same shortcut cancels the operation and puts you back in the original directory.
  51. ## Create your own plugins
  52. Plugins are scripts and all scripting languages should work. However, POSIX-compliant shell scripts runnable in `sh` are preferred. If that's too rudimentary for your use case, use Python, Perl or Ruby.
  53. You can create your own plugins by putting them in `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`.
  54. For example, you could create a executable shell script `git-changes`:
  55. #!/usr/bin/env sh
  56. git log -p -- "$@"
  57. And then trigger it by hitting the pick plugin key and selecting `git-changes` which will conveniently show the git log of changes to the particular file along with the code for a quick and easy review.
  58. ## Contributing plugins
  59. Please keep non-portable commands (like `notify-send`) commented so users from any other OS/DE aren't surprised.
  60. The plugins should be executable. Please add an entry in the table above.