Last active
July 20, 2017 19:34
-
-
Save vjo/b7eda7c2130092b5d488 to your computer and use it in GitHub Desktop.
Reload Firefox current page 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
| While developing website / webapp it's great to force your browser to reload when modifiying code. | |
| You have plenty of solutions like LiveReload. | |
| I wanted to be able to reload Firefox from vim and this is a simple way to achieve that: | |
| * Install MozRepl (https://github.com/bard/mozrepl/wiki) | |
| * Firefox > Tools > MozRepl > Start | |
| * Be sure you have netcat 'nc' installed | |
| * Add these line in your .vimrc: | |
| " Enable reloading of Firefox using MozRepl | |
| map ,r :! echo 'BrowserReload(); repl.quit();' \| nc -w 1 localhost 4242 2>&1 > /dev/null<CR><CR> | |
| Now when hitting ",r" in vim, Firefox will reload the current page. | |
| Derivated from: http://vim.wikia.com/wiki/Refresh_Firefox_%28preserving_scroll%29_on_Vim_save,_using_MozRepl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does Firefox still have a 'Tools' menu?
I can't seem to follow this part:
Firefox > Tools > MozRepl > Start
I'm unable to get any of these methods working. Is MozRepl maybe deprecated?
Thanks for any further input. : )