I have quite a few custom compose key sequences. I know I can get them working with an ~/.XCompose and switching the input method to xim. However, Sublime Text 2 doesn't accept any compose key sequences when I'm using xim. It does accept them when I'm using the default input method. I think I reported this bug for Sublime Text 2 a while ago.

Using the default input method, I added the contents of my ~/.XCompose to /usr/share/X11/locale/en_US.UTF-8/Compose but this did not change anything. Is there any way I can get the compose key sequences in my ~/.XCompose to work without relying on xim?


I know you asked this a year ago, but in case it ever helps someone, here’s what worked for me to enable custom .XCompose additions:

sudo apt-get install uim
export "GTK_IM_MODULE=uim"
(log out and in again)

uim is an input method which respects the compose file additions, but also enables the functionality not available in xim, eg Ctrl+Shift+U to enter a hex Unicode character ID.

This may work for the OP’s situation, if he still needs a solution, I don’t know.

  • 1
    Finally! After running into so many problems with xim and ibus, this finally solved my problem. You can also enable uim only for Sublime Text, by using export GTK_IM_MODULE=uim subl. – Gui Ambros Sep 21 '14 at 3:22

What @coteyr says is, in fact, not correct. Sublime Text uses standard GTK input method API, however, it does so incorrectly.

I made a package that fixes Sublime Text. You can find all the details on the bug and my workaround on my blog post but here's a quick overview of the installation:

  1. Add the sublime-imethod-fix-PPA to your APT sources by executing the following command:

    sudo add-apt-repository ppa:whitequark/sublime-imethod-fix
  2. Install the bugfix package that corresponds with your Sublime Text version:

    • for XCompose support in ST2:

      sudo apt-get install libsublime-text-2-xim-xcompose
    • for XCompose support in ST3:

      sudo apt-get install libsublime-text-3-xim-xcompose
  3. Restart Sublime Text (if it's running). Compose sequences should now work fine.

This is a hugely random guess, but I think it's because Sublime Text is using a different widget library and that one isn't setup for xim input.

You can try (if you haven't already) setting up persistent configuration at this link

If that doesn't work you can always hack IM support back in.

This post should assist with that.

Both are pretty technical and both mean going out of your way a bit to make it work.

  • I tried cjacker's solution from your second link but wasn't able to get it to work. If anyone has had some more luck with this I'd greatly appreciate it if you could outline your steps. – Glutanimate May 21 '13 at 17:11

Here's a workaround for Sublime Text 2 specifically. Install this package, either via Package Control or manually:

cd ~/.config/sublime-text-2/Packages

git clone https://github.com/xgenvn/InputHelper.git

After restarting Sublime you can access an input window for composed key sequences with Ctrl + Shift + Z. Hit Enter to insert the sequence at the cursor position.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.