Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

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.

share|improve this answer
    
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

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.

share|improve this answer

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.
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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