加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

破折号明星破折号( – * – )在Ruby文件中做什么?

发布时间:2020-12-17 03:49:31 所属栏目:百科 来源:网络整理
导读:我注意到一些 Ruby文件在顶部有一个部分,如下所示: # -*- mode: ruby -*- 一个例子是由Vagrant生成的Vagrantfile. 该部分实际上做了什么? 解决方法 这是emacs的 file mode specification When you visit a file,Emacs chooses a major mode automatically.
我注意到一些 Ruby文件在顶部有一个部分,如下所示:

# -*- mode: ruby -*-

一个例子是由Vagrant生成的Vagrantfile.

该部分实际上做了什么?

解决方法

这是emacs的 file mode specification

When you visit a file,Emacs chooses a major mode automatically. Normally,it makes the choice based on the file name—for example,files whose names end in ‘.c’ are normally edited in C mode—but sometimes it chooses the major mode based on special text in the file. This special text can also be used to enable buffer-local minor modes.

它基本上告诉Emacs使用ruby模式

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读