Created
December 11, 2012 21:53
-
-
Save aasmith/4262584 to your computer and use it in GitHub Desktop.
Reload safari when vim saves (OSX)
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
tell application "Safari" | |
activate | |
do JavaScript "window.location.reload();" in first document | |
end tell | |
tell application "MacVim" to activate |
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
" Place this in your ~/.vimrc | |
" Reload Safari page when saving html css, etc on OSX | |
autocmd BufWriteCmd *.html,*.css,*.haml :call Refresh_browser() | |
function! Refresh_browser() | |
if &modified | |
write | |
silent !osascript ~/.vim/refresh.applescript | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment