ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

SSH Config

SSH Config language and completions

Details

  • 5.0.0
    4.1.1
    1.1.3
  • github.​com
  • github.​com
  • 1 week ago
  • 4 days ago
  • 12 years ago

Installs

  • Total 17K
  • Win 5K
  • Mac 7K
  • Linux 4K
Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4
Windows 1 0 0 1 0 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 1 1 1 2 0 0 0 0 1 0 1 0 0 0 0 3 1 0 1 1 0 1
Mac 1 1 3 0 2 0 1 3 2 3 1 0 0 2 1 2 0 0 3 3 1 1 1 0 0 0 0 2 1 1 0 0 0 3 0 1 1 2 0 0 0 0 2 0 0 0
Linux 0 1 3 2 0 0 0 1 3 1 0 1 0 2 0 0 0 0 0 1 0 0 0 0 2 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 2 1 0 0 1 0

Readme

Source
raw.​githubusercontent.​com

SSH Config Language

Provides highlighting and snippets for ~/.ssh/config and /etc/ssh/sshd_config files.

Installation

This package is available via Package Control. You can install it by searching for SSH in the “Install Package” interface or by cloning this repository in your Sublime Text “Packages” directory.

SSH Config

  • host: create a new Host entry
  • match: create a new Match entry
  • Keyword completion for many *Nix and *BSD options
  • Symbol Index for hosts and aliases (Ctrl+R or Cmd+R)

Note that ~/.ssh/config is not linked to the SSH Config syntax highlighting out of the box. This is because the filename is shared by other formats (e.g. .git/config) and we don't want to set the wrong highlighting for those.

Here are three ways to change that:

  1. Use the “Open SSH Config” command to open your config, which proactively sets the right highlighting unless you disable it.
  2. Choose “Open all with current extension as…” from the syntax highlighting selection menu.
  3. Install and configure ApplySyntax to examine the whole path of the file and set the syntax highlighting after load. Sample configuration shown here

SSHD Config

  • Keyword completion for many *Nix and *BSD options
  • Symbol Index for active and commented-out config options (Ctrl+R or Cmd+R)

Commands

  • Open SSH Config File
  • Open SSHD Config File

If these commands open the wrong file for you, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P), search for “SSH Config: Settings”, and put in content like this:

Error: language “jsonc” is not supported
{
    "file_locations": {
        "ssh_config": "~/.ssh/config",
        "sshd_config": "/etc/ssh/sshd_config",
        "known_hosts": "~/.ssh/known_hosts",
        "authorized_keys": "~/.ssh/authorized_keys",
    },
}

Extras

  • authorized_keys and known_hosts also have
    • Syntax highlighting
    • Symbol index
    • (unmapped) “Open file” commands
  • PEM, PKCS1, PKCS8, and SSH keys have
    • Syntax
    • Symbol index for cert bundles
  • Completion and highlighting for crypto stuff
    • Key types
    • KEX algorithms
    • Encryption ciphers
    • MACs

Testing

  • Install this repository under Sublime Text Packages and name it SSH Config
    • You can clone it there directly, move it, or symlink it.
  • Open the project from under Packages/SSH Config
  • Open a syntax test file located in the Tests directory
  • Run Build With: Syntax Tests command
    • supplied by the Default Sublime Package
    • available on the command palette when a test file is open

The PackageDev package is helpful for writing tests, but not required.