Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hot reload on save

I'm currently using a terminal and vim on OSX as a development environment for Flutter. Things are going pretty well except that the app does not reload when I save any dart files. Is there a way to trigger that behavior?Currently I have to go to the terminal and hit "r" to see my changes.

like image 954
Bashar Avatar asked Mar 02 '26 12:03

Bashar


1 Answers

Sorry for the plug, but I wrote a very simple plugin to handle this.

It makes use of Flutter's --pid-file command line flag to send it a SIGUSR1 signal.

You can achieve the same result as my two-line plugin by adding this to an autocmd

silent execute '!kill -SIGUSR1 "$(cat /tmp/flutter.pid)"'

And launching Flutter with the --pid-file flag.

like image 103
nobody_nowhere Avatar answered Mar 05 '26 05:03

nobody_nowhere