设置新文件的默认语言 [英] Set default language for new files

查看:60
本文介绍了设置新文件的默认语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Atom中新创建的文件始终是纯文本".如何更改此设置,以便新文件将自动以另一种语言显示,例如"Shell Script(Bash)"?我想这样做是因为自动缩进不适用于纯文本文件.

Newly created files in Atom are always "Plain Text". How can I change this so that new files will automatically be in another language, for example "Shell Script (Bash)"? I want to do this because auto indentation does not work with Plain Text files.

推荐答案

也存在此问题,有一个名为默认语言将为您完成此操作.

Had this problem as well, there is a plugin called default-language that will do this for you.

搜索原子以获取默认语言,安装并打开其设置.输入您希望Atom默认使用的语言名称,例如默认语言"字段中的Shell脚本(如有疑问,请从语言选择菜单中复制).下次打开不带扩展名(或shebang)的脚本时,它将默认为您设置的语言.

Search atom for default-language, install and open its settings. Type the name of the language you want Atom to default to, e.g. Shell Script (if in doubt, copy from the language selection menu) in the Default Language field. Next time you open a script with no extension (or shebang) it'll default to the language you set.

这篇关于设置新文件的默认语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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