Skip to content

Instantly share code, notes, and snippets.

@vko-online
Created June 26, 2015 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vko-online/8fc32fb6bcf0369b3ab0 to your computer and use it in GitHub Desktop.
Save vko-online/8fc32fb6bcf0369b3ab0 to your computer and use it in GitHub Desktop.
Launch chrome from command line
### Alias for launching chrome from command line
### Add to .bashrc or .bash_profile or .zshrc (if zsh)
### ex: chrome twitter.com
function chrome(){
open -a 'Google Chrome' 'http://'$1;
}
@vko-online
Copy link
Author

Would be better to have autocomplete on popular websites, like some cool guy wrote here

UPD:

file:.chrome_cmd.bash

function chrome(){
    open -a 'Google Chrome' 'http://'$1;
}
_chrome()
{
cur=${COMP_WORDS[COMP_CWORD]}
case "${cur}" in
tw*) use="twitter.com" ;;
go*) use="google.com" ;;
esac
COMPREPLY=( $( compgen -W "$use" -- $cur ) )
}
complete -o default -o nospace -F _chrome chrome

error

command not found: complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment