zoukankan      html  css  js  c++  java
  • ubuntu14.04下解决编辑器无法输入中文

    phpstorm下。

     编辑 phpstorm/bin/phpstorm.sh

    在顶部加上

    export XMODIFIERS=”@im=fcitx” 
    export GTK_IM_MODULE=”fcitx” 
    export QT_IM_MODULE=”fcitx”

    ibus的话就改下ibus即可。

    sublime_text下

    1.首先需要下载gtk的lib文件

    sudo apt-get install libgtk2.0-dev

    2编辑文件:sublime_imfix.c

    复制代码
    #include <gtk/gtkimcontext.h>
    
    void gtk_im_context_set_client_window (GtkIMContext *context, GdkWindow    *window)
    {
        GtkIMContextClass *klass;
        g_return_if_fail (GTK_IS_IM_CONTEXT (context));
        klass = GTK_IM_CONTEXT_GET_CLASS (context);
    
        if (klass->set_client_window)
            klass->set_client_window (context, window);
    
        g_object_set_data(G_OBJECT(context),"window",window);
    
        if(!GDK_IS_WINDOW (window))
            return;
    
        int width = gdk_window_get_width(window);
        int height = gdk_window_get_height(window);
    
        if(width != 0 && height !=0)
            gtk_im_context_focus_in(context);
    
    }
    

    3.编译

    gcc -shared -o libsublime-imfix.so sublime_imfix.c  `pkg-config --libs --cflags gtk+-2.0` -fPIC

    4.然后将这个文件移动到sublime安装目录下,我的在/opt/sublime_text_2

    sudo mv libsublime-imfix.so /opt/sublime_text_2/

    5.编辑/usr/bin/subl文件,这是一个shell脚本

    #!/bin/bash
    LD_PRELOAD=/opt/sublime_text_2/libsublime-imfix.so exec /opt/sublime_text_2/sublime_text "$@"

    然后执行subl基本就可以了

  • 相关阅读:
    sb世博
    seo 工具集锦
    各种Windows 操作系统中的 .NET Framework 支持
    httplib2模拟登陆
    python tips
    B2C电子商务能否通吃线上线下?
    复制镜像
    Scale Stack vs node.js vs Twisted vs Eventlet
    pool=eventlet.GreenPool(20)
    nginx最新部署
  • 原文地址:https://www.cnblogs.com/g825482785/p/chineseide.html
Copyright © 2011-2022 走看看