Updated Basic use cases (markdown)

Mischievous Meerkat 2020-11-14 10:16:12 +05:30
parent 7a90a9aa81
commit 8dafff95e1

@ -27,7 +27,9 @@ If opted, `nnn` writes the last working directory to
By default `nnn` will cd on quit if the environment variable `NNN_TMPFILE` is set (it's exported in the sample quitcd scriptlets accordingly). To cd on quit only when <kbd>^G</kbd> is pressed (and return to start directory using other quit options), do not export `NNN_TMPFILE` in the rc file, use it as a local variable.
**Note:** The extra key <kbd>^G</kbd> to _cd on quit_ is to avoid writing to a file every time `nnn` quits. This also gives the user the flexibility to choose which directory (s)he wants to land into after starting `nnn` rather than having it decided beforehand.
Note:
- The extra key <kbd>^G</kbd> to _cd on quit_ is to avoid writing to a file every time `nnn` quits. This also gives the user the flexibility to choose which directory (s)he wants to land into after starting `nnn` rather than having it decided beforehand.
## Hot-plugged drives
@ -117,9 +119,10 @@ Start `nnn` with the program option `-e`.
If you are using `nuke` as opener modify it to use `ewrap` for text files. You can also enhance `ewrap` (re-use code from `nuke`) to handle text files by file type and use the right program (e.g. w3m for html, man for man pages). That way you don't have to change the opener.
**IMPORTANT:** Use the program option `-E` with detached text editing enabled. `nnn` internal operations which need to wait for the editor (like batch rename, copy/move as) wouldn't work as usual because the control returns to `nnn` after the terminal emulator is spawned. To avoid this, set `$VISUAL` as above and `$EDITOR` to a CLI editor (like `vim`). The program option forces `$EDITOR` to be used for internal operations (overriding `$VISUAL` which takes precedence otherwise).
Notes:
**Note:** If you are using a tiling window manager, the new terminal window with the editor would open beside your current window. In case of traditional window managers, the new window will be placed as per the window manager's placement configuration e.g. smart or centered on XFCE4.
1. **IMPORTANT:** Use the program option `-E` with detached text editing enabled. `nnn` internal operations which need to wait for the editor (like batch rename, copy/move as) wouldn't work as usual because the control returns to `nnn` after the terminal emulator is spawned. To avoid this, set `$VISUAL` as above and `$EDITOR` to a CLI editor (like `vim`). The program option forces `$EDITOR` to be used for internal operations (overriding `$VISUAL` which takes precedence otherwise).
2. If you are using a tiling window manager, the new terminal window with the editor would open beside your current window. In case of traditional window managers, the new window will be placed as per the window manager's placement configuration e.g. smart or centered on XFCE4.
Another options is to combine and use `nnn` with a multiplexer like `dvtm`:
@ -155,7 +158,9 @@ To configure `launch` as an independent app launcher add a keybind to open launc
GUI applications can also be launched from the prompt. Use `&` to launch in background so `nnn` isn't blocked.
**Note:** You can also launch an instance of your favorite terminal in the current directory (_**open terminal here...**_) this way.
Note:
- You can also launch an instance of your favorite terminal in the current directory (_**open terminal here...**_) this way.
## Open as root
@ -176,7 +181,7 @@ Ways to pick files:
- use selection and press <kbd>q</kbd> to quit
- press <kbd>Enter</kbd> to pick any earlier selection and the current entry (to avoid selecting the last file in the selection twice, press <kbd>q</kbd> instead).
**Notes:**
Notes:
1. pressing <kbd>Enter</kbd> on a directory enters it; when trying to pick a directory, e.g. to pipe to `cd`, use single file selection and press <kbd>q</kbd>
2. to discard selection and quit, press <kbd>^G</kbd>
@ -262,7 +267,7 @@ The unmount option (which also unmounts mounted archives BTW) works in 2 ways:
1. hover on the mountpoint, press <kbd>u</kbd> (this works for both remotes and archives)
2. if the current entry is not a mount point, `nnn` prompts for the remote host name
**Notes:**
Notes:
1. `nnn` takes you to the mount point after successful mounts. To jump back to the last directory, press the usual <kbd>-</kbd>.
2. More information on [SSHFS](https://wiki.archlinux.org/index.php/SSHFS).
@ -288,7 +293,9 @@ To duplicate the current entry:
- keep the name unchanged in the prompt and press <kbd>Enter</kbd>
- in the next prompt ("copy name"), provide the preferred name (and optionally the path to the duplicate file) for the duplicate and press <kbd>Enter</kbd>
NOTE: To cancel the rename or duplicate operations, press <kdb>Enter</kbd> in both prompts without changing the file name.
Note:
- To cancel the rename or duplicate operations, press <kdb>Enter</kbd> in both prompts without changing the file name.
## Create batch links