【问题标题】:How to remove the redundant encoding style for Sublime Text如何删除 Sublime Text 的冗余编码样式
【发布时间】:2014-02-20 04:36:54
【问题描述】:

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

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

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

【问题讨论】:

    标签: sublimetext2


    【解决方案1】:

    您可以编辑~/Library/Application Support/Sublime Text 2/Packages/Default/Main.sublime-menu 的这一部分并删除所有您不希望出现在Save with Encoding 菜单中的编码。

    {
        "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" } }
        ]
    },
    

    【讨论】:

      【解决方案2】:

      对于崇高 3:

       1. Go to Packages directory (in my case it is /opt/sublime_text/Packages)
       3. Make a backup of Default.sublime-package
       2. In Midnight Commander open archive Default.sublime-package (it is
          simply a zip archive) by pressing Enter key
       4. Copy Main.sublime-menu and Encoding.sublime-menu to temp directory
       5. Edit copied files and remove unnecessary encodings
       6. Copy changed files back to Default.sublime-package archive (i.e.
          with archive management abilities of Midnight Commander)
       7. Restart Sublime 3
      

      附言对不起我的英语不是我的母语

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-08-02
        • 1970-01-01
        • 2010-11-13
        • 2022-11-17
        相关资源
        最近更新 更多