Skip to content

Instantly share code, notes, and snippets.

@JamesOBenson
Created March 30, 2017 18:33
Show Gist options
  • Save JamesOBenson/cec1a89be43cfd59f312416a6d668d1a to your computer and use it in GitHub Desktop.
Save JamesOBenson/cec1a89be43cfd59f312416a6d668d1a to your computer and use it in GitHub Desktop.
Source: http://hints.macworld.com/article.php?story=20100113142633883
To have tab to complete from .ssh/config file in MacOS (Verified on MacOS 10.12.4),
vi ~/.bash_profile (New file)
# Copy and paste this line
complete -o default -o nospace -W "$(/usr/bin/env ruby -ne 'puts $_.split(/[,\s]+/)[1..-1].reject{|host| host.match(/\*|\?/)} if $_.match(/^\s*Host\s+/);' < $HOME/.ssh/config)" scp sftp ssh
source ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment