Skip to main content
 首页 » 编程设计

sublimetext2中如何去除Sublime Text的冗余编码风格

2024年11月24日78rubylouvre

我开始使用 Sublime Text,并且第一眼就爱上了它。我真的很喜欢这个强大的编辑器。我是来自中国的编辑,所以我想我只需要 UTF-8GBK 编码选项,但每次我想用指定的编码选项保存文件时,会有很多选项,比如

  • 西方(Windows 1521)
  • 西方 (ISO 8859-1)
  • 西方 (ISO 8859-3)
  • ...
  • 越南语 (Windows 1258)

所以我的问题是如何删除 Sublime Text 的冗余编码选项?

请您参考如下方法:

您可以编辑 ~/Library/Application Support/Sublime Text 2/Packages/Default/Main.sublime-menu 的这一部分,并删除您不希望出现的所有编码使用编码保存菜单。

{ 
    "caption": "Save with Encoding", 
    "children": 
    [ 
    { "caption": "UTF-8", "command": "save", "args": {"encoding": "utf-8" } }, 
    { "caption": "UTF-8 with BOM", "command": "save", "args": {"encoding": "utf-8 with bom" } }, 
    { "caption": "UTF-16 LE", "command": "save", "args": {"encoding": "utf-16 le" } }, 
    { "caption": "UTF-16 LE with BOM", "command": "save", "args": {"encoding": "utf-16 le with bom" } }, 
    { "caption": "UTF-16 BE", "command": "save", "args": {"encoding": "utf-16 be" } }, 
    { "caption": "UTF-16 BE with BOM", "command": "save", "args": {"encoding": "utf-16 be with bom" } }, 
    { "caption": "-" }, 
    { "caption": "Western (Windows 1252)", "command": "save", "args": {"encoding": "Western (Windows 1252)" } }, 
    { "caption": "Western (ISO 8859-1)", "command": "save", "args": {"encoding": "Western (ISO 8859-1)" } }, 
    { "caption": "Western (ISO 8859-3)", "command": "save", "args": {"encoding": "Western (ISO 8859-3)" } }, 
    { "caption": "Western (ISO 8859-15)", "command": "save", "args": {"encoding": "Western (ISO 8859-15)" } }, 
    { "caption": "Western (Mac Roman)", "command": "save", "args": {"encoding": "Western (Mac Roman)" } }, 
    { "caption": "DOS (CP 437)", "command": "save", "args": {"encoding": "DOS (CP 437)" } }, 
    { "caption": "Arabic (Windows 1256)", "command": "save", "args": {"encoding": "Arabic (Windows 1256)" } }, 
    { "caption": "Arabic (ISO 8859-6)", "command": "save", "args": {"encoding": "Arabic (ISO 8859-6)" } }, 
    { "caption": "Baltic (Windows 1257)", "command": "save", "args": {"encoding": "Baltic (Windows 1257)" } }, 
    { "caption": "Baltic (ISO 8859-4)", "command": "save", "args": {"encoding": "Baltic (ISO 8859-4)" } }, 
    { "caption": "Celtic (ISO 8859-14)", "command": "save", "args": {"encoding": "Celtic (ISO 8859-14)" } }, 
    { "caption": "Central European (Windows 1250)", "command": "save", "args": {"encoding": "Central European (Windows 1250)" } }, 
    { "caption": "Central European (ISO 8859-2)", "command": "save", "args": {"encoding": "Central European (ISO 8859-2)" } }, 
    { "caption": "Cyrillic (Windows 1251)", "command": "save", "args": {"encoding": "Cyrillic (Windows 1251)" } }, 
    { "caption": "Cyrillic (Windows 866)", "command": "save", "args": {"encoding": "Cyrillic (Windows 866)" } }, 
    { "caption": "Cyrillic (ISO 8859-5)", "command": "save", "args": {"encoding": "Cyrillic (ISO 8859-5)" } }, 
    { "caption": "Cyrillic (KOI8-R)", "command": "save", "args": {"encoding": "Cyrillic (KOI8-R)" } }, 
    { "caption": "Cyrillic (KOI8-U)", "command": "save", "args": {"encoding": "Cyrillic (KOI8-U)" } }, 
    { "caption": "Estonian (ISO 8859-13)", "command": "save", "args": {"encoding": "Estonian (ISO 8859-13)" } }, 
    { "caption": "Greek (Windows 1253)", "command": "save", "args": {"encoding": "Greek (Windows 1253)" } }, 
    { "caption": "Greek (ISO 8859-7)", "command": "save", "args": {"encoding": "Greek (ISO 8859-7)" } }, 
    { "caption": "Hebrew (Windows 1255)", "command": "save", "args": {"encoding": "Hebrew (Windows 1255)" } }, 
    { "caption": "Hebrew (ISO 8859-8)", "command": "save", "args": {"encoding": "Hebrew (ISO 8859-8)" } }, 
    { "caption": "Nordic (ISO 8859-10)", "command": "save", "args": {"encoding": "Nordic (ISO 8859-10)" } }, 
    { "caption": "Romanian (ISO 8859-16)", "command": "save", "args": {"encoding": "Romanian (ISO 8859-16)" } }, 
    { "caption": "Turkish (Windows 1254)", "command": "save", "args": {"encoding": "Turkish (Windows 1254)" } }, 
    { "caption": "Turkish (ISO 8859-9)", "command": "save", "args": {"encoding": "Turkish (ISO 8859-9)" } }, 
    { "caption": "Vietnamese (Windows 1258)", "command": "save", "args": {"encoding": "Vietnamese (Windows 1258)" } }, 
    { "caption": "-" }, 
    { "caption": "Hexadecimal", "command": "save", "args": {"encoding": "Hexadecimal" } } 
    ] 
},