Vim commands for Flutter, including hot-reload-on-save and more.
Usage documentation can be found both in this README, as well
as via calling
vim-flutter is a Vimscript-only plugin, and makes heavy
use of Vim8's async jobs. It can be installed with a
package manager like
, for example.
Though this package doesn't depend on it, having
available is recommended, for a betterexperience.
Plug 'dart-lang/dart-vim-plugin' Plug 'thosakwe/vim-flutter' " Run :PlugInstall to install the plugin.
Ultimately, installation is up to you.
g:flutter_command- The Flutter executable path/name; defaults to
g:flutter_hot_reload_on_save- Whether to auto hot-reload when
dartfiles are saved; defaults to
:FlutterRun <args>- calls
flutter run <args>
:FlutterHotReload- triggers a hot reload on the current Flutter process
:FlutterHotRestart- triggers a hot restart on the current Flutter process
:FlutterQuit- quits the current Flutter process
:FlutterDevices- opens a new buffer, and writes the output of
flutter devicesto it
:FlutterSplit- opens Flutter output in a horizontal split
The following are self-explanatory:
If you are using a GUI Vim Variant, you can add a
Flutter menu by calling
Hot Reload on Save
A convenient feature to have when working with Flutter is
to automatically hot-reload an app once a file is saved.
By default, whenever a
dart file is saved, if and only if
a Flutter process is running, it will be hot-reloaded.
You can disable this by setting
vim-flutter is loaded.
Plug 'thosakwe/vim-flutter' call plug#end() " Enable Flutter menu call FlutterMenu() " Some of these key choices were arbitrary; " it's just an example. nnoremap <leader>fa :FlutterRun<cr> nnoremap <leader>fq :FlutterQuit<cr> nnoremap <leader>fr :FlutterHotReload<cr> nnoremap <leader>fR :FlutterHotRestart<cr>