The command you want is :e
(short for :edit
). If you use :edit!
it will discard local changes and reload.
You can also have vim do this automatically with set autoread
in your vimrc.
https://www.jianshu.com/p/be2660714986
----------------------------------------------
google上搜索了一下,说是当前文件夹被写入了root权限,所以用普通用户无法编辑,只要将当前文件夹的权限改变一下即可
sudo chown -R $USER <directory_project>
例如我的是这样解决的
cd <你项目所在的目录>
sudo chown -R mac ./项目文件夹名