Created
December 3, 2012 04:45
-
-
Save aasmith/4192762 to your computer and use it in GitHub Desktop.
Reload the current chrome tab when vim saves (unix/X)
This file contains 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
#!/bin/bash | |
# Add this script to your ~/bin (ensure in $PATH) and chmod +x. | |
# Requires xdotool. | |
# | |
# Add this to your vimrc: | |
# " reload chrome on html/css/js save | |
# au BufWritePost *.{html,css,js} silent !reload-chrome.sh | |
CUR=$(xdotool getwindowfocus) | |
WID=$(xdotool search --onlyvisible --class "google-chrome" | sort -n | head -1) | |
xdotool windowactivate $WID | |
xdotool key 'F5' | |
xdotool windowactivate $CUR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment