17
17

More than 5 years have passed since last update.

Vimで作業しながらブラウザをリロード

Posted at
~/bin/reload.scpt
if application "Safari" is running then tell application "Safari"       do JavaScript "location.reload(true);" in document 1    end tellend ifif application "Google Chrome" is running then    tell application "Google Chrome" to reload active tab of window 1end if~~~~

このapplescriptを`~/bin/reload.scpt`とかに+xして置いて、vimから呼び出す。

~~~~vim:.vimrc
augroup MyBrowserReload
  command! -bar BrowserReload silent !osascript $HOME/bin/reload.scpt
augroup END
nnoremap <silent> <Leader>rl :BrowserReload<CR>

これでvimでファイルを編集しつつ<Leader>rlでリロードできる。…が、リロードする度にtmuxが爆発してしまい微妙にスタメンから外れている。

17
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
17