由于某种原因,我无法在Sublime Text 3中键入带重音符的字符,例如á、å和ä。相反,我只能得到以下输出:´a、°a和¨a。当我按下它们的键时,会打印出帽子符号,而不是允许我输入一个带重音符的字符。顺便说一句,我使用的是冰岛键盘。
Sublime Text版本为3065,Ubuntu 64位系统。运行在Ubuntu 14.10上。
这个问题在Ubuntu 14.04上对我来说没有出现。
由于某种原因,我无法在Sublime Text 3中键入带重音符的字符,例如á、å和ä。相反,我只能得到以下输出:´a、°a和¨a。当我按下它们的键时,会打印出帽子符号,而不是允许我输入一个带重音符的字符。顺便说一句,我使用的是冰岛键盘。
Sublime Text版本为3065,Ubuntu 64位系统。运行在Ubuntu 14.10上。
这个问题在Ubuntu 14.04上对我来说没有出现。
对于使用ABNT2键盘的巴西用户,我有一些赞美之词。
在首选项 > 键绑定 - 用户中,添加以下代码片段:
[
// missing accented characters fix for ubuntu 14.10
// a, [á, à, ã, â, å, ä]
{ "keys": ["´","a"], "command": "insert", "args": {"characters": "á"}},
{ "keys": ["`","a"], "command": "insert", "args": {"characters": "à"}},
{ "keys": ["~","a"], "command": "insert", "args": {"characters": "ã"}},
{ "keys": ["^","a"], "command": "insert", "args": {"characters": "â"}},
{ "keys": ["°","a"], "command": "insert", "args": {"characters": "å"}},
{ "keys": ["¨","a"], "command": "insert", "args": {"characters": "ä"}},
// A, [Á, À, Ã, Â, Å, Ä]
{ "keys": ["´","A"], "command": "insert", "args": {"characters": "Á"}},
{ "keys": ["`","A"], "command": "insert", "args": {"characters": "À"}},
{ "keys": ["~","A"], "command": "insert", "args": {"characters": "Ã"}},
{ "keys": ["^","A"], "command": "insert", "args": {"characters": "Â"}},
{ "keys": ["°","A"], "command": "insert", "args": {"characters": "Å"}},
{ "keys": ["¨","A"], "command": "insert", "args": {"characters": "Ä"}},
// e, [é, è, ê, ẽ, ë]
{ "keys": ["´","e"], "command": "insert", "args": {"characters": "é"}},
{ "keys": ["`","e"], "command": "insert", "args": {"characters": "è"}},
{ "keys": ["^","e"], "command": "insert", "args": {"characters": "ê"}},
{ "keys": ["~","e"], "command": "insert", "args": {"characters": "ẽ"}},
{ "keys": ["¨","e"], "command": "insert", "args": {"characters": "ë"}},
// E, [É, È, Ê, Ẽ, Ë]
{ "keys": ["´","E"], "command": "insert", "args": {"characters": "É"}},
{ "keys": ["`","E"], "command": "insert", "args": {"characters": "È"}},
{ "keys": ["^","E"], "command": "insert", "args": {"characters": "Ê"}},
{ "keys": ["~","E"], "command": "insert", "args": {"characters": "Ẽ"}},
{ "keys": ["¨","E"], "command": "insert", "args": {"characters": "Ë"}},
// i, [ì, í, ï]
{ "keys": ["`","i"], "command": "insert", "args": {"characters": "ì"}},
{ "keys": ["´","i"], "command": "insert", "args": {"characters": "í"}},
{ "keys": ["¨","i"], "command": "insert", "args": {"characters": "ï"}},
// I, [Ì, Í, Ï]
{ "keys": ["`","I"], "command": "insert", "args": {"characters": "Ì"}},
{ "keys": ["´","I"], "command": "insert", "args": {"characters": "Í"}},
{ "keys": ["¨","I"], "command": "insert", "args": {"characters": "Ï"}},
// o, [ó, õ, ô, ö]
{ "keys": ["´","o"], "command": "insert", "args": {"characters": "ó"}},
{ "keys": ["~","o"], "command": "insert", "args": {"characters": "õ"}},
{ "keys": ["^","o"], "command": "insert", "args": {"characters": "ô"}},
{ "keys": ["¨","o"], "command": "insert", "args": {"characters": "ö"}},
// O, [Ó, Õ, Ô, Ö]
{ "keys": ["´","O"], "command": "insert", "args": {"characters": "Ó"}},
{ "keys": ["~","O"], "command": "insert", "args": {"characters": "Õ"}},
{ "keys": ["^","O"], "command": "insert", "args": {"characters": "Ô"}},
{ "keys": ["¨","O"], "command": "insert", "args": {"characters": "Ö"}},
// u, [ú, ů, ü]
{ "keys": ["´","u"], "command": "insert", "args": {"characters": "ú"}},
{ "keys": ["°","u"], "command": "insert", "args": {"characters": "ů"}},
{ "keys": ["¨","u"], "command": "insert", "args": {"characters": "ü"}},
// U, [Ú, Ů, Ü]
{ "keys": ["´","U"], "command": "insert", "args": {"characters": "Ú"}},
{ "keys": ["°","U"], "command": "insert", "args": {"characters": "Ů"}},
{ "keys": ["¨","U"], "command": "insert", "args": {"characters": "Ü"}},
// y, [ý, ÿ]
{ "keys": ["´","y"], "command": "insert", "args": {"characters": "ý"}},
{ "keys": ["¨","y"], "command": "insert", "args": {"characters": "ÿ"}},
// Y, [Ý, Ÿ]
{ "keys": ["´","Y"], "command": "insert", "args": {"characters": "Ý"}},
{ "keys": ["¨","Y"], "command": "insert", "args": {"characters": "Ÿ"}}
]
我找到了一种解决方法,在Sublime Text中转到首选项>按键绑定-用户,将下面的代码添加到打开的文件Default (Linux).sublime-keymap
中并保存。
请注意,这是一个hacky的解决方法,并且可能没有你需要/想要的所有重音字母,在这种情况下,你可以轻松地添加这些缺失的字母。还要注意,这个解决方法并没有攻击问题的根源,我认为这与Ubuntu 14.10有关。
[
// missing accented characters fix for ubuntu 14.10
// a, [á, å, ä]
{ "keys": ["´","a"], "command": "insert", "args": {"characters": "á"}},
{ "keys": ["°","a"], "command": "insert", "args": {"characters": "å"}},
{ "keys": ["¨","a"], "command": "insert", "args": {"characters": "ä"}},
// A, [Á, Å, Ä]
{ "keys": ["´","A"], "command": "insert", "args": {"characters": "Á"}},
{ "keys": ["°","A"], "command": "insert", "args": {"characters": "Å"}},
{ "keys": ["¨","A"], "command": "insert", "args": {"characters": "Ä"}},
// e, [é, ë]
{ "keys": ["´","e"], "command": "insert", "args": {"characters": "é"}},
{ "keys": ["¨","e"], "command": "insert", "args": {"characters": "ë"}},
// E, [É, Ë]
{ "keys": ["´","E"], "command": "insert", "args": {"characters": "É"}},
{ "keys": ["¨","E"], "command": "insert", "args": {"characters": "Ë"}},
// i, [í, ï]
{ "keys": ["´","i"], "command": "insert", "args": {"characters": "í"}},
{ "keys": ["¨","i"], "command": "insert", "args": {"characters": "ï"}},
// I, [Í, Ï]
{ "keys": ["´","I"], "command": "insert", "args": {"characters": "Í"}},
{ "keys": ["¨","I"], "command": "insert", "args": {"characters": "Ï"}},
// o, [ó, ö]
{ "keys": ["´","o"], "command": "insert", "args": {"characters": "ó"}},
{ "keys": ["¨","o"], "command": "insert", "args": {"characters": "ö"}},
// O, [Ó, Ö]
{ "keys": ["´","O"], "command": "insert", "args": {"characters": "Ó"}},
{ "keys": ["¨","O"], "command": "insert", "args": {"characters": "Ö"}},
// u, [ú, ů, ü]
{ "keys": ["´","u"], "command": "insert", "args": {"characters": "ú"}},
{ "keys": ["°","u"], "command": "insert", "args": {"characters": "ů"}},
{ "keys": ["¨","u"], "command": "insert", "args": {"characters": "ü"}},
// U, [Ú, Ů, Ü]
{ "keys": ["´","U"], "command": "insert", "args": {"characters": "Ú"}},
{ "keys": ["°","U"], "command": "insert", "args": {"characters": "Ů"}},
{ "keys": ["¨","U"], "command": "insert", "args": {"characters": "Ü"}},
// y, [ý, ÿ]
{ "keys": ["´","y"], "command": "insert", "args": {"characters": "ý"}},
{ "keys": ["¨","y"], "command": "insert", "args": {"characters": "ÿ"}},
// Y, [Ý, Ÿ]
{ "keys": ["´","Y"], "command": "insert", "args": {"characters": "Ý"}},
{ "keys": ["¨","Y"], "command": "insert", "args": {"characters": "Ÿ"}}
]
First add the repository
sudo add-apt-repository ppa:whitequark/sublime-imethod-fix
and secondly install the patch
sudo apt-get install libsublime-text-3-xim-xcompose
感谢Peter Zotov制作了这个补丁。
//missing composite characters for Czech alphabet
{ "keys": ["´","A"], "command": "insert", "args": {"characters": "Á"}},
{ "keys": ["´","a"], "command": "insert", "args": {"characters": "á"}},
{ "keys": ["ˇ","C"], "command": "insert", "args": {"characters": "Č"}},
{ "keys": ["ˇ","c"], "command": "insert", "args": {"characters": "č"}},
{ "keys": ["ˇ","D"], "command": "insert", "args": {"characters": "Ď"}},
{ "keys": ["ˇ","d"], "command": "insert", "args": {"characters": "ď"}},
{ "keys": ["´","E"], "command": "insert", "args": {"characters": "É"}},
{ "keys": ["´","e"], "command": "insert", "args": {"characters": "é"}},
{ "keys": ["ˇ","E"], "command": "insert", "args": {"characters": "Ě"}},
{ "keys": ["ˇ","e"], "command": "insert", "args": {"characters": "ě"}},
{ "keys": ["´","I"], "command": "insert", "args": {"characters": "Í"}},
{ "keys": ["´","i"], "command": "insert", "args": {"characters": "í"}},
{ "keys": ["ˇ","N"], "command": "insert", "args": {"characters": "Ň"}},
{ "keys": ["ˇ","n"], "command": "insert", "args": {"characters": "ň"}},
{ "keys": ["´","O"], "command": "insert", "args": {"characters": "Ó"}},
{ "keys": ["´","o"], "command": "insert", "args": {"characters": "ó"}},
{ "keys": ["ˇ","R"], "command": "insert", "args": {"characters": "Ř"}},
{ "keys": ["ˇ","r"], "command": "insert", "args": {"characters": "ř"}},
{ "keys": ["ˇ","S"], "command": "insert", "args": {"characters": "Š"}},
{ "keys": ["ˇ","s"], "command": "insert", "args": {"characters": "š"}},
{ "keys": ["ˇ","T"], "command": "insert", "args": {"characters": "Ť"}},
{ "keys": ["ˇ","t"], "command": "insert", "args": {"characters": "ť"}},
{ "keys": ["´","U"], "command": "insert", "args": {"characters": "Ú"}},
{ "keys": ["´","u"], "command": "insert", "args": {"characters": "ú"}},
{ "keys": ["´","Y"], "command": "insert", "args": {"characters": "Ý"}},
{ "keys": ["´","y"], "command": "insert", "args": {"characters": "ý"}},
{ "keys": ["ˇ","Z"], "command": "insert", "args": {"characters": "Ž"}},
{ "keys": ["ˇ","z"], "command": "insert", "args": {"characters": "ž"}}
这里有一个快速修复Sublime Text的方法:
将以下代码添加到您的代码顶部:
# coding=utf-8
或者
-- coding: utf-8 --
两种方法都可以。