In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the solution that Sublime Text 3 cannot input Chinese under Ubuntu14.4". In the daily operation, I believe that many people have doubts about the problem that Sublime Text 3 cannot input Chinese under Ubuntu14.4. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt that "Sublime Text 3 can not input Chinese under Ubuntu14.4". Next, please follow the editor to study!
Tools / raw materials
Ubuntu14.04
Sogou Input for Linux
Sublime text 3
Known precondition
1. This experience has been successfully installed in the case of Sogou Input for Linux and Sublime Text 3 in Ubuntu14.04 environment.
END
Solution step 2
1. Save the following code to the file sublime_imfix.c (located in the ~ directory)
The code is as follows:
# include
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)
}
2. Compile the code in the previous step into a shared library > libsublime-imfix.so, command
Cd ~
Gcc-shared-o libsublime-imfix.so sublime_imfix.c `pkg-config-- libs-- cflags gtk+- 2.0`-fPIC
3. Then copy > libsublime-imfix.so to the folder where > sublime_text is located
Sudo mv libsublime-imfix.so / opt/sublime_text/
4. Modify the contents of file / usr/bin/subl
> sudo gedit / usr/bin/subl
Set
#! / bin/sh
Exec / opt/sublime_text/sublime_text "$@"
Modify to
> #! / bin/sh
> LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec / opt/sublime_text/sublime_text "$@"
At this point, execute > subl in the command and you can use the Chinese input of Sogou for linux >
5. In order to use the right mouse button to open the file with Chinese input, you also need to modify the contents of the file sublime_text.desktop.
Command
> sudo gedit / usr/share/applications/sublime_text.desktop
Change the string in [Desktop Entry]
Exec=/opt/sublime_text/sublime_text% F
Modify to
Exec=bash-c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec / opt/sublime_text/sublime_text% F"
Change the string in [Desktop Action Window]
Exec=/opt/sublime_text/sublime_text-n
Modify to
Exec=bash-c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec / opt/sublime_text/sublime_text-n"
Change the string in [Desktop Action Document]
Exec=/opt/sublime_text/sublime_text-command new_file
Modify to
Exec=bash-c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec / opt/sublime_text/sublime_text-- command new_file"
Note:
Please pay attention to double quotation marks > "when you modify it, otherwise you will not be able to open a file with a space file name.
Only > / usr/share/applications/sublime-text.desktop has been modified here, but it can be used normally.
The > sublime-text.desktop under the opt/sublime_text/ directory can be modified or not.
6. After the above steps, we can enter Chinese in Sublime.
At this point, the study of "the solution to the inability to enter Chinese in Sublime Text 3 under Ubuntu14.4" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.