Last active
December 29, 2015 05:06
-
-
Save fellipebrito/e35f976c3d952d6f4714 to your computer and use it in GitHub Desktop.
Dynamic browser search from a yanked text in VIM from a vagrant box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
# Use: browser_search.sh <query-to-be-searched> | |
set QUERY [lindex $argv 0] | |
set username "YOUR_USERNAME" | |
set hostname "YOUR_HOSTNAME" | |
# In Case you need a password. You can use this var and uncomment lines bellow | |
# It is better to add your public ssh key in authorized keys in your HOST | |
set password "YOUR_PASSWORD" | |
spawn ssh ${username}@${hostname} | |
# expect "Password: " | |
# send "${password}\r" | |
expect "$ " | |
send "open https://www.google.com/#q=${QUERY}\r" | |
expect "$ " | |
send "exit\r" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map <Leader>bs :!browser_search.sh <C-r>"<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment