Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sunlei/zsh-ssh

Better host completion for ssh in Zsh.
https://github.com/sunlei/zsh-ssh

completion fzf shell ssh zsh zsh-completion zsh-plugin

Last synced: 2 months ago
JSON representation

Better host completion for ssh in Zsh.

Awesome Lists containing this project

README

        

# zsh-ssh

Better host completion for ssh in Zsh.

[![asciicast](https://asciinema.org/a/381405.svg)](https://asciinema.org/a/381405)

- [zsh-ssh](#zsh-ssh)
- [Installation](#installation)
- [Zinit](#zinit)
- [Antigen](#antigen)
- [Oh My Zsh](#oh-my-zsh)
- [Sheldon](#sheldon)
- [Manual (Git Clone)](#manual-git-clone)
- [Usage](#usage)
- [SSH Config Example](#ssh-config-example)

## Installation

Make sure you have [fzf](https://github.com/junegunn/fzf) installed.

### Zinit

```shell
zinit light sunlei/zsh-ssh
```

### Antigen

```shell
antigen bundle sunlei/zsh-ssh
```

### Oh My Zsh

1. Clone this repository into `$ZSH_CUSTOM/plugins` (by default `~/.oh-my-zsh/custom/plugins`)

```shell
git clone https://github.com/sunlei/zsh-ssh ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-ssh
```

2. Add the plugin to the list of plugins for Oh My Zsh to load (inside `~/.zshrc`):

```shell
plugins=(zsh-ssh $plugins)
```

3. Start a new terminal session.

### Sheldon

1. Add this config to `~/.config/sheldon/plugins.toml`

```toml
[plugins.zsh-ssh]
github = 'sunlei/zsh-ssh'
```

2. Run `sheldon lock` to install the plugin.

3. Start a new terminal session.

### Manual (Git Clone)

1. Clone this repository somewhere on your machine. For example: `~/.zsh/zsh-ssh`.

```shell
git clone https://github.com/sunlei/zsh-ssh ~/.zsh/zsh-ssh
```

2. Add the following to your `.zshrc`:

```shell
source ~/.zsh/zsh-ssh/zsh-ssh.zsh
```

3. Start a new terminal session.

## Usage

Just press Tab after `ssh` command as usual.

### SSH Config Example

You can use `#_Desc` to set description.

~/.ssh/config

```text
Host Bastion-Host
Hostname 1.1.1.1
User sunlei

Host Development-Host
Hostname 2.2.2.2
IdentityFile ~/.ssh/development-host
#_Desc For Development
```