diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2021-01-18 13:16:40 -0700 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2021-01-18 13:16:40 -0700 |
commit | c6e754a3119b7273a57f0cfed38e85303662d26b (patch) | |
tree | c50ae3c6b0271ec88e964d3a57199ea37e63bf0b /plugins/last-working-dir/README.md | |
parent | fb45741fc1dbd40dd2be72bc35a28c6ee8f3f7a5 (diff) | |
parent | efcbd9f3480a28ec69c607c46adcbfd8d230ac9f (diff) | |
download | zsh-c6e754a3119b7273a57f0cfed38e85303662d26b.tar.gz zsh-c6e754a3119b7273a57f0cfed38e85303662d26b.tar.bz2 zsh-c6e754a3119b7273a57f0cfed38e85303662d26b.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/last-working-dir/README.md')
-rw-r--r-- | plugins/last-working-dir/README.md | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/plugins/last-working-dir/README.md b/plugins/last-working-dir/README.md index ced9e0370..b5cc55828 100644 --- a/plugins/last-working-dir/README.md +++ b/plugins/last-working-dir/README.md @@ -1,15 +1,33 @@ # last-working-dir plugin Keeps track of the last used working directory and automatically jumps into it -for new shells, unless: +for new shells, unless the starting directory is not `$HOME`. -- The plugin is already loaded. -- The current `$PWD` is not `$HOME`. - -Also adds `lwd` function to jump to the last working directory. +Also adds a `lwd` function to jump to the last working directory. To use it, add `last-working-dir` to the plugins array in your zshrc file: ```zsh plugins=(... last-working-dir) ``` + +## Features + +### Use separate last-working-dir files with different SSH keys + +If the same user account is used by multiple users connecting via different SSH keys, you can +configure SSH to map them to different `SSH_USER`s and the plugin will use separate lwd files +for each one. + +Make sure that your SSH server allows environment variables. You can enable this feature +within the `/etc/sshd/sshd_config` file: + +``` +PermitUserEnvironment yes +``` + +Then, add `environment="SSH_USER=<SSH_USERNAME>"` before the SSH keys in your `authorized_keys` file: + +``` +environment="SSH_USER=a.test@example.com" ssh-ed25519 AAAAC3Nz... +``` |