-
-
Save aliou/2369894 to your computer and use it in GitHub Desktop.
Reload Google Chrome from Vim
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
function! ChromeReload() | |
let applescript = "-e \"tell application \\\"Google Chrome\\\" to tell the active tab of its first window \r | |
\reload \r | |
\end tell \r | |
\tell application \\\"Google Chrome\\\" to activate\"" | |
silent exec "!osascript " . applescript | |
endfunction | |
command! ChromeReload call ChromeReload() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Like the @zachwill's version, this reloads the active tab of Chrome. However, instead of passing the Applescript to Python, it just sends it as a regular shell command, meaning that if your VIM isn't compiled with a language, this script will work (provided that you are using OS X). To launch it more easily, you can map it:
Also, if your into submodules in your VIM config, you can also add this as a submodule, since all gist are actually git repos:
# In the root of your git repo: git submodule add git://gist.github.com/2369894.git path/to/your/submodules/folder/ChromeReload-vim