diff --git a/Basic-use-cases.md b/Basic-use-cases.md index 51315d0..3f94061 100644 --- a/Basic-use-cases.md +++ b/Basic-use-cases.md @@ -269,17 +269,19 @@ mocp -a $(nnn -p -) ## Remote mounts -`nnn` integrates with SSHFS and rclone to support remote mounts. The mount points (for remotes as well as archives) are created within: +`nnn` integrates with `sshfs` and `rclone` to support remote mounts. The mount points (for remotes as well as archives) are created within: ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/mounts Upon successful unmount, the mount points are removed. -#### SSHFS +The key to mount a remote folder is c (for *c*onnect). + +#### sshfs Example primary setup: [connect to SSH sever from desktop](https://gist.github.com/jarun/660fd1d5e79e1a4038de8ba5f2e1a513). -To connect to and mount remote shares using SSHFS, `nnn` requires the ssh configuration file `~/.ssh/config` to have the host entries. sshfs reads this file. +To connect to and mount remote shares using `sshfs`, `nnn` requires the ssh configuration file `~/.ssh/config` to have the host entries. sshfs reads this file. Example host entry for a Termux environment on Android device: @@ -297,6 +299,15 @@ Host phone # ProxyJump jumphost ``` +Once you try to connect using `sshfs`, `nnn` will prompt for the name of the host (`phone` in the example above). Type the exact name (as it appears in this file) optionally followed by the path in the remote host you want to mount. + +Examples: + +``` +phone <----- Mount your remote user's $HOME folder in `phone` +phone:/tmp <----- Mount the remote `tmp` folder in `phone` +``` + Host `phone` will be mounted at `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/mounts/phone`. If you need to pass options to the `sshfs` command, you can do so: @@ -311,7 +322,7 @@ Options must be preceded by `sshfs` and comma-separated without any space betwee The remote needs to be [configured and authenticated](https://rclone.org/docs/) beforehand (one-time activity). The name used to configure is all `nnn` needs to connect and mount (as well as unmount) the remote service locally. -Like SSHFS, if you need to pass options, use the dedicated environment variable: +If you need to pass options, use the dedicated environment variable for `rclone`: ```sh export NNN_RCLONE='rclone mount --read-only --no-checksum' @@ -325,13 +336,13 @@ Tip: To list all the remotes in the rclone config file: `rclone listremotes` The unmount option (which also unmounts mounted archives BTW) works in 2 ways: -1. hover on the mount point, press u (this works for both remotes and archives) +1. hover on the mount point, press u (for *u*nmount). 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: 1. `nnn` opens the mount point in a smart context after successful mounts. -2. More information on [SSHFS](https://wiki.archlinux.org/index.php/SSHFS). +2. More information on [sshfs](https://wiki.archlinux.org/index.php/SSHFS). ## Synced quick notes Open your note file OR directory (if your editor supports opening a dir like `vim`) in your favourite editor like a plugin (see plugin docs for more info):