将TextMate 2设置为默认编辑器


2

如何将TextMate 2设置为Mac OSX Sierra中文本文件的默认编辑器?

根据第二个答案 https://stackoverflow.com/questions/9370584/mac-os-x-set-textmate-as-default-text-editor 我试过了:

defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.macromates.textmate;}'

但它似乎不起作用 - 当我打开一个文件时 .txt 扩展它在TextEdit中打开。

请注意,我 寻找像接受的答案一样的手动解决方案 https://stackoverflow.com/questions/9370584/mac-os-x-set-textmate-as-default-text-editor

Answers:


1

你需要写信给 com.apple.LaunchServices/com.apple.launchservices.secure

defaults write com.apple.LaunchServices/com.apple.launchservices.secure \
    LSHandlers -array-add \
    '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.macromates.textmate;}'

然后注销以使更改生效。


不起作用:(
traveh
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.