Giter Club home page Giter Club logo

sublime-text-imfix's Introduction

Sublime Text 3 Input Method(Fcitx) Fix [Ubuntu(Debian)]

This fix may not work in Sublime Text GTK3 build 3181+, see issue #68. HELP WANTED!!

Main Purposes

This repo is aimed at doing the following three things:

  • Install Sublime Text 3
  • Install Fcitx Input Method
  • Fix Sublime Text 3's input method problem(Mainly for CJK characters) under Ubuntu(Debian) System

Updates

  • (new) Fix "Package Preference" cannot open issue. Thanks for @liberize
  • (new) Now, Sublime opened by Icon.desktop can also use Fcitx Input(Dash Icon also work)
  • (new) Fix cursor position not update bug
  • (new) Support 32-bit system. Thanks for @inouetoukyou

Important Note

  • Sublime Text 3 input method fix only works when executing from terminal, such as subl .

Usage

Steps to use this repo:

  • Update and then upgrade your system to the newest
sudo apt-get update && sudo apt-get upgrade
  • Clone this repo in your local directory :
git clone https://github.com/lyfeyaj/sublime-text-imfix.git
  • Change your current directory to sublime-text-imfix:
cd sublime-text-imfix
  • Run the below script :
./sublime-imfix
  • Done! Re-login your X windows. And then you can enjoy using Sublime Text 3 with Fctix Input Method!

Completion Preview:

Fcitx

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

Sublime Text 3 输入法(Fcitx)修复[Ubuntu(Debian)]

主要目的

  • 安装 Sublime Text 3
  • 安装 Fcitx 输入法 + 皮肤
  • 修复 Sublime Text 3's 在 Ubuntu(Debian) 系统下的无法输入中文(CJK 字符)输入法的问题

更新

  • (new) 修复了 "Package Preference" 无法打开的问题, 感谢 @liberize
  • (new) 通过 Ubuntu 系统图标打开的 Sublime 也支持 Fcitx 输入中文了
  • (new) 修复了输入法不跟随的 Bug
  • (new) 支持 32位 系统. 感谢 @inouetoukyou

注意

  • 这个修复仅当在终端中使用 subl . 调用 Sublime Text 的时有效, 具体原因请看源代码src/subl

使用方法

  • 更新并升级系统为最新(较新的系统会解决很多可能出现的问题)
sudo apt-get update && sudo apt-get upgrade
  • 克隆项目到本地 :
git clone https://github.com/lyfeyaj/sublime-text-imfix.git
  • 运行脚本 :
cd sublime-text-imfix && ./sublime-imfix
  • 完成! 重新启动后就可以在 Sublime Text 3 中 使用 Fcitx了! 注意: 皮肤可能需要自己选择 ^_^

效果图:

Fcitx

sublime-text-imfix's People

Contributors

dongjinleekr avatar fuyuanli avatar jack-q avatar lyfeyaj avatar mark24code avatar walkinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublime-text-imfix's Issues

[enhancement] vintage模式下, 能否做到如fcitx.vim的效果

众所周知, 使用vim模式进行输入的时候, 当用户退出到normal模式状态时, 输入法状态会保留在insert模式时的状态, 而原生vim的解决方案时通过插件fcitx.vim来自动做切换, 方便了很多用户. 那么, 我们IMFIX是否也可以顺便修补这个问题呢?

Can't open Preferences - Browse Packages

First, Thank you for your library.
I'm using ubuntu 14.04(64bit), fcitx(actually fcitx-hangul; Korean), sublime-text-3, and sublime-text-imfix.
It works fine, and I can make myself input Korean.

However, I have found out that 'Preferences - Browse Packages' is not openned.
I'm just using Sublime-text, so I don't know about this one well.
I googled, and I have found something that indicates there are some issues on this library.

http://html5beta.com/page/ubuntu-14-04-install-fcitx-sougoupinyin-sublime-text-3-chinese-input-fix.html

I hope you might take a look at this.
Thanks.

cannot be preloaded

OS: Debian
Kernel: i686 Linux 4.9.0-3-686-pae
WM: Mutter(DeepinGala)
CPU: Intel Celeron CPU G530 @ 2.4GHz
GPU: GeForce GT 430
RAM: 600MB / 2002MB

puppy@stretch:~$ subl
ERROR: ld.so: object '/opt/sublime_text/libsublime-imfix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

启动之后不能输入中文,是i686的原因吗,该如何解决呢

输入法备选框还是不跟随。

ubuntu 16.04 已更新,
sublime 3143
输入法:拼音(fcitx),sunpinyin(fcitx)
现象,在终端启动subl后,输入法备选框一直在subl window的左下角,然后移动subl window,输入法备选框始终固定在初识位置,甚至可以不在subl window内。
是否必须使用搜狗拼音?

搜狗输入法显示的位置不适合

首先,非常感谢楼主的解决方案,目前尝试了介绍的方法,已经能够正确在Sublime 3内正确输入中文。
目前还有一点儿小的问题,就是在输入中文时,输入法显示的位置并不十分合适,无论在哪里输入一直显示在左下角的位置。
所以,提一个issue,^_^

sublime 3126 没有成功

按照教程来的,用的是root权限也不行,无法输入中文,是新版本的问题吗??

Fix for fcitx does not work, but fix for xim immodule works for fcitx

At first, thank you so much for this wonderful fix.

It is very strange that in my case, after patching this fix, I cannot get it to work. Everytime when I switch to fcitx in sublime text, it will keep switching back to English keyboard again, and I cannot type in any Chinese characters at all. However, after I delete all the lines from 38 to 115 in sublime-imfix.c (all the codes concerning fcitx are deleted and xim are left) and then re-compile and use it, this time it works very well. I can type in Chinese characters with fcitx as usual! So I am very confused about the outcome - why codes for fcitx does not work for fcitx but those for xim does work for fcitx in my case?

My environment is as follows:

  • OS: ubuntu 14.04 + i3wm/xfce4
  • Imput Method: fcitx 4.2.8.5
  • Sublime Ver 3.0, Build 3143
  • sublime-text-imfix: commit de1cc97 (latest)

Thank you for your help!

不清楚是不是这个项目导致了搜狗输入法的问题。

目前搜狗输入法无法正常使用。
~$ sogou-qimpanel
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
~$ No LSB modules are available.
No LSB modules are available.
(WARN-19143 /build/fcitx-PSoVA1/fcitx-4.2.9.1/src/lib/fcitx-config/fcitx-config.c:922) Invalid Entry: line 148 missing '='

This fix stop working with Sublime Text GTK3 build 3181+

Hi,

I just noticed today that after I rerun sublime-imfix after updating to latest Sublime Text dev build 3184, the fix stop working and SublimeText cannot be opened.

My guess is that, since build 3181, ST has moved to GTK3+ and this may conflict with this fix.

This fix is really useful for me to use fcitx within ST3.

gentoo 外挂 libsublime-imfix.so 同样还是无法切换中文输入法。

  • OS: 4.4.6-gentoo x64
  • DESKTOP: gnome-shell-3.18.5
  • fcitx-4.2.8.5
  • Sublime Text Build 3114

看了一遍 sublime-imfix 脚本,重点应该是 libsublime-imfix.so 模块,在 sublime_text 启动前得 “额外加载”。遵从以上方式在 Gentoo Linux 中执行此方法。同样还是无法切换至中文输入法。跟没加载一个样。 sublime_imfix.c 难道还区分不同系统吗?望给个回复。多谢!

库中的 libsublime-imfix.so 跟 自己编译的 libsublime-imfix.so 都尝试过。

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

LD_PRELOAD=./libsublime-imfix.so sublime_text

以上方式同样
screenshot from 2016-08-18 19-13-20

IME does not cooperate with the editor after save dialog for a new file is shown

Hello,

I found a situation that the editor does not work well with IME.
Symptoms are:

  • IME catches characters.
  • IME also catches Space, and Shift + Space (as a command to select between conversions).
  • IME does no catches inputs of enter, tab, backspace, cursor keys, and delete (they are directly sent to the editor).

Below is the way to reproduce in my environment (Arch Linux / Cinnamon / Fcitx-mozc):

  1. Create a new buffer.
  2. Select File -> Save and show the Save File dialog.
  3. Close it by saving or canceling.

I'd appreciate to offer more information if necessary. Thanks.

关于从sublime里面创建文件然后保存文件后的拼音无法正常输入

你好,我用window用习惯了,就是这个我在sublime里面ctrl+N创建新文件,然后保存其他类型文件后,拼音输入法不正常的问题,又回到了只删除汉字又不删除拼音的尴尬境地。请问能不能更新以下嘛。我还是比较喜欢用sublime,这是除了微软自带的记事本以外我用的第二个记事本。

phpcs无法正常使用

DPI scale: 1.05
startup, version: 3126 linux x64 channel: stable
executable: /opt/sublime_text/sublime_text
working dir: /
packages path: /home/shawn/.config/sublime-text-3/Packages
state path: /home/shawn/.config/sublime-text-3/Local
zip path: /opt/sublime_text/Packages
zip path: /home/shawn/.config/sublime-text-3/Installed Packages
ignored_packages: ["Vintage"]
top level value must be an array
pre session restore time: 0.072559
warning: mnemonic e not found in menu caption 文件的新视图(E)
warning: mnemonic v not found in menu caption 恢复文件(V)
warning: mnemonic x not found in menu caption 退出(X)
warning: mnemonic n not found in menu caption 剪切(N)
warning: mnemonic m not found in menu caption 注释(M)
warning: mnemonic a not found in menu caption 转换大小写(A)
warning: mnemonic i not found in menu caption 查找(I)
warning: mnemonic n not found in menu caption 行结束标识(N)
warning: mnemonic w not found in menu caption 自动换行(W)
warning: mnemonic t not found in menu caption 切换文件(T)
warning: mnemonic b not found in menu caption 书签(B)
warning: mnemonic u not found in menu caption 编译系统(U)
warning: mnemonic v not found in menu caption 保存宏(V)…
warning: mnemonic d not found in menu caption 将文件夹添加到项目(D)…
warning: mnemonic m not found in menu caption 从项目中删除所有文件夹(M)
warning: mnemonic e not found in menu caption 刷新文件夹(E)
startup time: 0.183727
first paint time: 0.206204
first paint time: 0.274626
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.indentation
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_file_settings
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin 0_package_control_loader.00-package_control
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin PackageResourceViewer.package_resource_viewer
reloading plugin PackageResourceViewer.package_resources
reloading plugin Phpcs.phpcs
reloading plugin Sublimerge 3.Sublimerge
reloading plugin Codecs33.Codecs33
reloading plugin ConvertToUTF8.ConvertToUTF8
reloading plugin HTML-CSS-JS Prettify.HTMLPrettify
plugins loaded
[Phpcs] Project files:
[Phpcs] Current: None
[Phpcs] Last Known: None
[Phpcs] No project file defined, therefore skipping reload
[Phpcs] /usr/local/bin/php-cs-fixer fix /home/shawn/www/index/tp5/app/controller/User.php --verbose
[Phpcs] /usr/local/bin/php-cs-fixer fix /home/shawn/www/index/tp5/app/controller/User.php --verbose
[Phpcs] cwd: /home/shawn
[Phpcs]
(php:8884): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

[Phpcs] php -l -d display_errors=On /home/shawn/www/index/tp5/app/controller/User.php
[Phpcs] php -l -d display_errors=On /home/shawn/www/index/tp5/app/controller/User.php
[Phpcs] cwd: /home/shawn
[Phpcs]
(php:8883): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

[Phpcs] Linter found 0 errors
Package Control: Skipping automatic upgrade, last run at 2017-04-24 21:02:39, next run at 2017-04-24 22:02:39 or after

不知道装了什么,以前正常的,现在就提示GTK问题,貌似是2和3不能同时使用。
https://forum.sublimetext.com/t/sublime-does-not-support-chinese/886/5

输入法窗口不跟框

输入法窗口不跟框,永远悬浮在左下角。
看到前辈的输入法演示是跟框的有什么解决的思路吗?

Eventually input using IME doesn't work well in mozc / Arch Linux / Cinnamon

At first, thank you for making this fix. Basically it works well.
However, sometimes (several ten minutes after I start the editor) input from IME stops working like this (I hit Enter key to confirm the input at the last in this movie):
peek 2017-08-08 12-25
When I restart ST3, it works well again, like:
peek 2017-08-08 12-32

So sorry but I've not yet grasped how this fix works, therefore I wonder how can I fix this.

My environment is:

This has not yet been happened on any other application.
I know the information I provide is very poor to speculate the cause, but I would be very grateful if I can get any clue to solve this.
I'd appreciate your help.

Not work in Ubuntu 17.10

Can't not switch to Sogou Pinyin.

lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful

ii fcitx 1:4.2.9.1-6 all Flexible Input Method Framework
ii sogoupinyin 2.1.0.0086 amd64 Sogou Pinyin Input Method
ii sublime-text 3143 amd64 Sublime Text is a sophisticated text editor for code, markup and pro

32bit system error

$ ./sublime-imfix
$ subl
ERROR: ld.so: object '/opt/sublime_text/libsublime-imfix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
$ cd src
$ gcc -shared -o libsublime-imfix.so sublime-imfix.c  `pkg-config --libs --cflags gtk+-2.0` -fPIC
$ sudo cp libsublime-imfix.so /opt/sublime_text/
$ subl

修正只能在终端中打开才能输入中文问题

请参考百度经验这篇文章可以正常打开输入中文:http://jingyan.baidu.com/article/f3ad7d0ff8731609c3345b3b.html ,以下是引用的文字:

为了使用鼠标右键打开文件时能够使用中文输入,还需要修改文件sublime_text.desktop的内容。
命令:

sudo gedit /usr/share/applications/sublime_text.desktop

将[Desktop Entry]中的字符串

Exec=/opt/sublime_text/sublime_text %F

修改为

Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F"

将[Desktop Action Window]中的字符串

Exec=/opt/sublime_text/sublime_text -n

修改为

Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text -n"

将[Desktop Action Document]中的字符串

Exec=/opt/sublime_text/sublime_text --command new_file

修改为

Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text --command new_file"

注意:

修改时请注意双引号"",否则会导致不能打开带有空格文件名的文件。
此处仅修改了/usr/share/applications/sublime-text.desktop,但可以正常使用了。
opt/sublime_text/目录下的sublime-text.desktop可以修改,也可不修改。

新建的编译Fortran受影响

编译Fortran使得能够在gnome-terminal中输入,但是用了这个能够输入中文以后,Ctrl + B,就不能运行了,卸载重新安装,编译没有报错了,但是,再用你的这个输入中文,有出现同样报错,我新建的编译系统如下

{
"cmd": ["gnome-terminal -- bash -c "f95 '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'; read -p '\nPress any key to continue...'""],
"shell":true,
"working_dir" : "$file_path",
"selector" : "source.f90",
"working_dir" : "$file_path",
"encoding":"UTF-8",

"variants":
[
	{
		"name": "Run in sublime",
	    "shell_cmd": "gfortran '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'",


	}
]

}

中文输入导致sublime崩溃

打开两个sublime,来回切换,只能在一个窗口输入,关闭能输入的窗口再在没关闭的窗口输入不能输入成功,而且会崩溃

Linux ubuntu 通过 subl 命令打开 sublime-text 输入法退格问题

在Linux 上通过命令打开 sublime-text ,输入法在输入中文出现候选字的时候(这个时候还未选择汉字),现在按下退格,将不能删除输入框上的 字母拼音, 而是删除了编辑文件的内容,候选框依然无法消失,依然还显示在屏幕上,然而用图标打开 sublime text 就不会出现这个问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.