标签:pycharm
最近两一直,被pycharm的输入法困扰,在google上搜索了,各种方法也都试了,都不行。
最后按照官网上说法进行试验,终于获得了成功。
注:加粗的为注意的操作
具体步骤如下:
[maokx@localhost bin]$ vi pycharm.sh
# ---------------------------------------------------------------------
if [ -n "$PYCHARM_PROPERTIES" ]; then
IDE_PROPERTIES_PROPERTY="-Didea.properties.file=\"$PYCHARM_PROPERTIES\""
fi
MAIN_CLASS_NAME="$PYCHARM_MAIN_CLASS_NAME"
if [ -z "$MAIN_CLASS_NAME" ]; then
MAIN_CLASS_NAME="com.intellij.idea.Main"
fi
VM_OPTIONS_FILE="$PYCHARM_VM_OPTIONS"
if [ -z "$VM_OPTIONS_FILE" ]; then
VM_OPTIONS_FILE="$IDE_BIN_HOME/pycharm$BITS.vmoptions"
fi
if [ -r "$VM_OPTIONS_FILE" ]; then
VM_OPTIONS=`"$CAT" "$VM_OPTIONS_FILE" | "$GREP" -v "^#.*" | "$TR" ‘\n‘ ‘ ‘`
VM_OPTIONS="$VM_OPTIONS -Djb.vmOptionsFile=\"$VM_OPTIONS_FILE\""
fi
IS_EAP="false"
if [ "$IS_EAP" = "true" ]; then
OS_NAME=`echo $OS_TYPE | "$TR" ‘[:upper:]‘ ‘[:lower:]‘`
AGENT_LIB="yjpagent-$OS_NAME$BITS"
if [ -r "$IDE_BIN_HOME/lib$AGENT_LIB.so" ]; then
AGENT="-agentlib:$AGENT_LIB=disablej2ee,disablealloc,delay=10000,sessionname=PyCharm30"
fi
fi
COMMON_JVM_ARGS="\"-Xbootclasspath/a:$IDE_HOME/lib/boot.jar\" -Didea.paths.selector=PyCharm30 $IDE_PROPERTIES_PROPERTY"
IDE_JVM_ARGS="-Didea.platform.prefix=Python -Didea.no.jre.check=true"
ALL_JVM_ARGS="$VM_OPTIONS $COMMON_JVM_ARGS $IDE_JVM_ARGS $AGENT $REQUIRED_JVM_ARGS"
CLASSPATH="$IDE_HOME/lib/bootstrap.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/extensions.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/util.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/jdom.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/log4j.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/trove4j.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/jna.jar"
if [ -n "$PYCHARM_CLASSPATH" ]; then
CLASSPATH="$CLASSPATH:$PYCHARM_CLASSPATH"
fi
export CLASSPATH
LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
# ---------------------------------------------------------------------
# Run the IDE.
# ---------------------------------------------------------------------
while true ; do
"pycharm.sh" 183L, 5929C written
[maokx@localhost bin]$ a^C
[maokx@localhost bin]$ ^C
[maokx@localhost bin]$
就这样就可以了。
原来,按照一般的说法:
在~/bashrc 里面写入:
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
实验证明,这样是失败的。
还有一种说法是:
通过qt-config进行配置,但实验证明也是不行的。
官方解释如下:
To obtain a better experience in Gtk+ and Qt programs, install the fcitx-gtk2, fcitx-gtk3, fcitx-qt4 and fcitx-qt5 input method modules as your need, or the fcitx-im group to install all of them (with the exception of fcitx-qt5 which is currently not popular).
Add the following lines to your desktop start up script files to register the input method modules and support xim programs.
.xprofile
if you are using KDM, GDM, LightDM or SDDM..xinitrc
if you are using startx or Slim. export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx
标签:pycharm
原文地址:http://blog.csdn.net/maokexu123/article/details/44515019