browsereload-mac.vim


Ⅰ. 插件描述

vimplugin. scripts to reflesh your browser. works only MacOS

Ⅱ. 基本信息

创建日期:  2011-06-01
使用用户:  116
Github星:  40
插件作者:  tell k

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'tell-k/browsereload-mac-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'tell-k/browsereload-mac-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'tell-k/browsereload-mac-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/tell-k/vim-browsereload-mac

Ⅳ. 文档说明

========================

browsereload-mac.vim

Description

vim plugin to reflesh your browser.
this plugin works only MacOSX.

Required

osascript(AppleScript command)

Installation

::

wget https://github.com/tell-k/vim-browsereload-mac/tarball/master -O browsereload-mac-vim.tar.gz
tar xvzf browsereload-mac-vim.tar.gz
mv tell-k-vim-browsereload-mac-* browsereload-mac-vim
cp -pr ./browsereload-mac-vim/plugin/browsereload-mac.vim ~/.vim/plugin/

see also install.sh

Documentation(Read The Docs)

Note

if you want to reload Firefox. Please change your System Preferences on MacOSX as below.

check "Enable access for assistive devices"::

System Preferences > Universal Access > "Enable access for assistive devices"

If you're using "OS X Marvericks", please do the following settings.::

System Preferences > Security & Privacy> Accessbillity> Privacy > Check your Editor.

Usage

browser reload::

:ChromeReload //reload "Google Chrome"
:FirefoxReload //reload "Firefox"
:SafariReload //reload "Safari"
:OperaReload //reload "Opera"
:AllBrowserReload //reload all browser

start auto reload::

:ChromeReloadStart
:FirefoxReloadStart
:SafariReloadStart
:OperaReloadStart
:AllBrowserReloadStart

stop auto reload::

:ChromeReloadStop
:FirefoxReloadStop
:SafariReloadStop
:OperaReloadStop
:AllBrowserReloadStart

Settings

after reload browser. forcus "Terminal" apps.

if you want to change fourcus application,
change variables "g:returnApps" to your appliation.

::

"change this variables
let g:returnApp = "Terminal"

if you want to stop returnApp,
change variables "g:returnAppFlag" to 0

::

"default is 1
let g:returnAppFlag = 1

if you want old style commad,
write this setting in your .vimrc

::

"reload
command! -bar Cr silent ChromeReload
command! -bar Fr silent FirefoxReload
command! -bar Sr silent SafariReload
command! -bar Or silent OperaReload
command! -bar Ar silent AllBrowserReload
"auto reload start
command! -bar CrStart silent ChromeReloadStart
command! -bar FrStart silent FirefoxReloadStart
command! -bar SrStart silent SafariReloadStart
command! -bar OrStart silent OperaReloadStart
command! -bar ArStart silent AllBrowserReloadStart
"auto reload stop
command! -bar CrStop silent ChromeReloadStop
command! -bar FrStop silent FirefoxReloadStop
command! -bar SrStop silent SafariReloadStop
command! -bar OrStop silent OperaReloadStop
command! -bar ArStop silent AllBrowserReloadStop

You can define "reloadPreHook" and "reploadPostHook" commands.

::

" default is not setting.
" 1. execute "reloadPreHook" command. -> 2. refresh browser.
let g:reloadPreHook = "sh bulid_assets.sh"

" 1. refresh browser. -> 2. execute "reloadPostHook" command.
let g:reloadPostHook = "sh bulid_assets.sh"

I recommend that you use along with the vimproc.vim <https://github.com/Shougo/vimproc.vim>_.
Because hook commands to be performed asynchronously.

添加新评论