相信很多同学都在使用Atom编辑器来查看和编辑代码,但在使用Atom来查看caffe的模型定义文件,即ProtoBuf文本文件时,发现并不能语法高亮显示,看起来不太舒服:

查看窗口右下角,此时的文本类型只是Plain Text/纯文本,因为Atom不认识这种语言:

解决办法:
在Packages=>Settings View=>Open,打开设置界面:

然后点击Install,在搜索栏中搜索prototxt,搜索相关的package:

发现有一个叫做language-prototxt的包,看下面的描述:highlight and qiuck navigation supports for .prototxt file, the model definition file of Caffe。正是我们需要的!点击Install安装。
不过貌似包下载出了问题:

安装不了,再往下滑动看看有没有其他相似功能的包,看到了这个:

说是对谷歌的protobuf提供语法高亮,应该也可以,点击Install安装。
安装好以后,确实有效果:

看起来舒服多了。
此时查看右下角的语言项也已经自动切换到了protobuf:

网友评论