README.md | 55 +++++++++++++++++++++++++++-------------------------- nnn.1 | 8 +++++++- src/nnn.c | 15 ++++++++++++--- diff --git a/README.md b/README.md index b335f9180ed73ed1638cf0457a99082604202dc2..8cffd69c1ddd81f67d0cd1cf21150d7352bdc087 100644 --- a/README.md +++ b/README.md @@ -22,35 +22,36 @@ `nnn` is also a du analyzer, an app launcher, a batch renamer and a file picker. The [plugin repository](https://github.com/jarun/nnn/tree/master/plugins#nnn-plugins) has tons of plugins and documentation to extend the capabilities further. You can _plug_ new functionality _and play_ with a hotkey. There's an independent [(neo)vim plugin](https://github.com/mcchrish/nnn.vim). It runs smoothly on the Pi, [Termux](https://www.youtube.com/watch?v=AbaauM7gUJw) (Android), Linux, macOS, BSD, Haiku, Cygwin, WSL, across DEs and GUI utilities or a strictly CLI environment. -Once installed (instructions below), visit the [Wiki](https://github.com/jarun/nnn/wiki). +## Black magic! :dark_sunglasses: -## Black magic! +1. Load and filter thousands of files instantly +2. Turbo navigate with automatic dir selection +3. Select files from anywhere (not just a single dir) +4. Run custom commands with custom hotkeys +5. Edit and preview markdown, man page, html +6. Open a file and auto-proceed to the next +7. Export (filtered) list of visible files +8. Find files by mime-type and list in `nnn` +9. Write a plugin in any language you know +10. Configure the middle mouse click to do anything +11. Fuzzy search subtree and open the dir of a file +12. Load four dirs with custom settings at once +13. Show notifications on cp, mv completion +14. Auto-sync selection to system clipboard +15. Open text files detached in another pane/tab/window +16. Create files/dirs/duplicates with parents (like `mkdir -p`) +17. Toggle hidden with ., go HOME with ~ or to the last dir with - +18. Pin a frequently visited dir at runtime +19. Mount any cloud storage service in a few keypresses +20. Mount and modify archives +21. Filter filtered entries +22. Sort files by access time and inode change time +23. Access selection from another instance of `nnn` +24. Compile out features you don't need +25. Watch matrix text fly or read fortune messages +26. Configure it in 5 minutes! -1. Turbo navigate with automatic dir selection -2. Select files from anywhere (not just a single dir) -3. Run custom commands with custom hotkeys -4. Edit and preview markdown, man page, html quickly -5. Open a file and auto-proceed to the next -6. Export (filtered) list of files to a text file -7. Find files by mime-type and list in `nnn` -8. Write a plugin in any language you know -9. Configure the middle mouse click to do anything -10. Fuzzy search subtree and open the directory of a file -11. Load four dirs with custom settings at once -12. Show notifications on cp, mv completion -13. Auto-sync selection to system clipboard -14. Open text files detached in another pane/tab/window -15. Create files/dirs/duplicates with parents (like `mkdir -p`) -16. Toggle hidden with ., go HOME with ~ or to the last dir with - -17. Pin a frequently visited directory at runtime -18. Mount any cloud storage service in few keypresses -19. Mount and modify archives -20. Filter filtered entries -21. Sort files by access time and inode change time -22. Access selection from another instance of `nnn` -23. Compile out features you don't need -24. Watch matrix text flying or read random fortune messages -25. Configure it in 5 minutes! +Once installed (instructions below), _**read the fine [manual](https://github.com/jarun/nnn/wiki)**_. ## Features diff --git a/nnn.1 b/nnn.1 index 69efdcf5de478f8a6a6e8db7e11b0ad3133ae52f..2af1a72f433e7a5ae42070e455cec2d4d829c6f8 100644 --- a/nnn.1 +++ b/nnn.1 @@ -252,7 +252,13 @@ .Pp A selection can be edited, copied, moved, removed, archived or linked. .Pp Absolute paths of the selected files are copied to \fB.selection\fR file in -the config directory. +the config directory. The selection file is shared between multiple program +instances. The most recent instance writing to the file overwrites the entries +from earlier writes. If you have 2 instances if +.Nm +\fIopen\fR in 2 panes of a terminal multiplexer, you can select in one pane and +use the selection (e.g. to copy or move) in the other pane (if the instance +doesn't have any local selection already). .Pp To edit the selection use the _edit selection_ key. Use this key to remove a file from selection after you navigate away from its directory. Editing doesn't diff --git a/src/nnn.c b/src/nnn.c index 4d9ed0bde1e1911449980c389a4198b211fb32b7..6e920b188672d3c441967918ba7b78d34caa84ef 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -539,7 +539,7 @@ "'c'li / 'g'ui?", "overwrite?", "'s'ave / 'l'oad / 'r'estore?", "Quit all contexts?", - "remote name: ", + "remote name ('-' for hovered): ", "archive name: ", "open with: ", "relative path: ", @@ -3892,7 +3892,7 @@ return TRUE; } -static bool remote_mount(char *newpath) +static bool remote_mount(char *newpath, char *currentpath) { uchar flag = F_CLI; int opt; @@ -3926,6 +3926,15 @@ tmp = xreadline(NULL, messages[MSG_HOSTNAME]); if (!tmp[0]) { printmsg(messages[MSG_CANCEL]); return FALSE; + } + + if (tmp[0] == '-' && !tmp[1]) { + if (!strcmp(cfgdir, currentpath) && ndents && (dents[cur].flags & DIR_OR_LINK_TO_DIR)) + xstrlcpy(tmp, dents[cur].name, NAME_MAX + 1); + else { + printmsg(messages[MSG_FAILED]); + return FALSE; + } } /* Create the mount point */ @@ -5568,7 +5577,7 @@ if (strcmp(path, newpath) == 0) break; } // fallthrough case SEL_REMOTE: - if (sel == SEL_REMOTE && !remote_mount(newpath)) { + if (sel == SEL_REMOTE && !remote_mount(newpath, path)) { presel = MSGWAIT; goto nochange; }