Skip to content

Instantly share code, notes, and snippets.

@aasmith
Created December 3, 2012 04:45
Show Gist options
  • Save aasmith/4192762 to your computer and use it in GitHub Desktop.
Save aasmith/4192762 to your computer and use it in GitHub Desktop.
Reload the current chrome tab when vim saves (unix/X)
#!/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