Created
March 8, 2012 16:42
-
-
Save zachwill/2001993 to your computer and use it in GitHub Desktop.
Reload Google Chrome from Vim
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
" Reload Google Chrome on Mac from Vim. | |
" Adapted from: https://github.com/gcollazo/BrowserRefresh-Sublime/ | |
function! ChromeReload() | |
python << EOF | |
from subprocess import call | |
browser = """ | |
tell application "Google Chrome" to tell the active tab of its first window | |
reload | |
end tell | |
tell application "Google Chrome" to activate | |
""" | |
call(['osascript', '-e', browser]) | |
EOF | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you haven't used Vim functions before, you can map this like the following in your
.vimrc
: