2014-02-20 46 views
2

我開始使用崇高文本並在第一眼就愛上它。我非常喜歡這個強大的編輯器。我是來自中國的編輯,所以我認爲我只需要使用UTF-8GBK編碼選項,但是每次當我想用指定的編碼選項保存文件時,都會有很多選項,比如作爲如何刪除崇高文本的冗餘編碼風格

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

所以我的問題是如何刪除Sublime Text的冗餘編碼選項?

回答

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

對於卓異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 

P.S.對不起我的英語,因爲它不是我的母語