保存时热装 [英] Hot reload on save

查看:100
本文介绍了保存时热装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在OSX上使用终端和vim作为Flutter的开发环境.一切进行得很好,除了保存我的任何dart文件时不会重新加载该应用程序.有没有一种方法可以触发这种行为?目前,我必须去终端并按"r"键才能看到我的更改.

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.

推荐答案

很抱歉,但是我写了一个非常简单的插件来处理.

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

它使用Flutter的--pid-file命令行标志向其发送SIGUSR1信号.

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

通过将其添加到autocmd

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

然后使用--pid-file标志启动Flutter.

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

这篇关于保存时热装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆