Reload flutter when saving a dart file without using --pid-file
option.
- Add
Plug 'hankchiutw/flutter-reload.vim'
to your vimrc file. - Reload your vimrc or restart
- Run
:PlugInstall
Vundle or similar
- Add
Plugin 'hankchiutw/flutter-reload.vim'
to your vimrc file. - Reload your vimrc or restart
- Run
:BundleInstall
- Add
NeoBundle 'hankchiutw/flutter-reload.vim'
to your vimrc file. - Reload your vimrc or restart
- Run
:NeoUpdate
cd ~/.vim/bundle
git clone https://github.com/hankchiutw/flutter-reload.vim.git
(For Neovim, change ~/.vim/
to ~/.config/nvim/
.)
curl -fLo ~/.vim/plugin/reload.vim --create-dirs \
https://raw.githubusercontent.com/hankchiutw/flutter-reload.vim/master/plugin/reload.vim
curl -fLo ~/.vim/ftplugin/dart.vim --create-dirs \
https://raw.githubusercontent.com/hankchiutw/flutter-reload.vim/master/ftplugin/dart.vim
md ~\vimfiles\plugin
md ~\vimfiles\doc
$pluguri = 'https://raw.githubusercontent.com/hankchiutw/flutter-reload.vim/master/plugin/reload.vim'
$ftpluguri = 'https://raw.githubusercontent.com/hankchiutw/flutter-reload.vim/master/ftplugin/dart.vim'
(New-Object Net.WebClient).DownloadFile($pluguri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("~\vimfiles\plugin\reload.vim"))
(New-Object Net.WebClient).DownloadFile($ftpluguri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("~\vimfiles\ftplugin\dart.vim"))
In your flutter project, you will exectue flutter run
(or flutter run -d {DEVICE_NAME}
to specify the device you want).
NO NEED to use --pid-file
to specify a pid file.
Make some changes to your project's *.dart files and you will see flutter reload automatically.
Simply sending SIGUSR1
to the flutter process in vim's BufWritePost
.
(inspired from reisub0/hot-reload.vim)