如何配置我的mac来打开Sublime Text 2(或其他编辑器)中没有扩展名的文件[重复]


2

这个问题在这里已有答案:

我想要

open ~/.profile

打开我的 .profile Sublime Text 2中的文件。我知道如何使用.txt文件执行此操作,但我无法弄清楚如何使用没有扩展名的文件。


1
您可以更改默认应用程序 public.plain-text UTI通过编辑 com.apple.LaunchServices.plist 或者使用duti或RCDefaultApp。
Lri

Answers:


0

如果您正在谈论命令行,只需设置Sublime Text 2的CLI。看到 Sublime Text 2:OS X命令行 。基本上运行:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

完成后,您可以使用以下命令打开任何文件:

subl ~/.profile

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.