Ubuntu14.04LTS64-bit installation and activation of SublimeText3 and solutions to problems that cannot be entered in Chinese 1. Download and install SublimeText3 and log on to the official website: Workshop;
Ubuntu 14.04 LTS 64-bit installation and activation of Sublime Text 3 and solutions to the problem of failure to enter Chinese Characters
1. Download and install Sublime Text 3
Log on to the official website: http://www.sublimetext.com/3
Download the 64-bit Ubuntu version and double-click it to complete the installation.
Note: To enable Sublime Text 3 on a terminal, enter subl on the terminal.
2. Registration
Help -->
-- Begin license --
Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
942194A6 02396E98 E62C9979 4BB979FE
91424C9D A45400BF F6747D88 2FB88078
90F5CC94 1csc92dc 8457107A F151657B
1D22E383 A997F016 42397640 33F41CFC
E1D0AE85 A0BBD039 0E9C8D55 E1B89D5D
5CDB7036 E56DE1C0 EFCC0840 492cd3a6
B98FC99C 8FAC73EE D2B95564 df316523
-- End license --
3. Solve Chinese Input Problems
A. Save the following code to the file sublime_imfix.c (located in ~ Directory)
# Include
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 );
}
B. Compile the code from the previous step into a shared library libsublime-imfix.so, command
Gcc-shared-o libsublime-imfix.so sublime_imfix.c 'pkg-config -- libs -- cflags gtk +-1000'-fPIC
NOTE: If gtk/gtkimcontext. h: the file or directory does not exist, there is no relevant dependent software. Install the command:
Sudo apt-get install build-essential libgtk2.0-dev
C. Copy the libsublime-imfix.so to the folder where sublime_text is located
Sudo mv libsublime-imfix.so/opt/sublime_text/
D. Modify the file/usr/bin/subl content
Sudo gedit/usr/bin/subl
Set
#! /Bin/sh
Exec/opt/sublime_text "$ @"
Change
#! /Bin/sh
LD_PRELOAD =/opt/sublime_text/libsublime-imfix.so exec/opt/sublime_text "$ @"
E. To enable Chinese input when right-clicking a file, you also need to modify the content of the file sublime_text.desktop. Command
Sudo gedit/usr/share/applications/sublime_text.desktop
Replace the string in [Desktop Entry]
Exec =/opt/sublime_text % F
Change
Exec = bash-c "LD_PRELOAD =/opt/sublime_text/libsublime-imfix.so exec/opt/sublime_text % F"
Set the string in [Desktop Action Window]
Exec =/opt/sublime_text-n
Change
Exec = bash-c "LD_PRELOAD =/opt/sublime_text/libsublime-imfix.so exec/opt/sublime_text-n"
Set the string in [Desktop Action Document]
Exec =/opt/sublime_text -- command new_file
Change
Exec = bash-c "LD_PRELOAD =/opt/sublime_text/libsublime-imfix.so exec/opt/sublime_text -- command new_file"
More about Sublime Text:
Ubuntu install code editor Sublime Text 3 (Build 3083) http://www.linuxidc.com/Linux/2015-03/115534.htm
Dynamic Graph Display 16 Sublime Text Shortcut Key Usage http://www.linuxidc.com/Linux/2014-12/110930.htm
Ubuntu 12.10 install and crack Sublime Text 2Http://www.linuxidc.com/Linux/2013-07/86898.htm
Ubuntu 13.04 install Sublime Text 2 http://www.linuxidc.com/Linux/2013-05/84228.htm
Code artifact-Sublime Text package management tools and extensions Daquan http://www.linuxidc.com/Linux/2013-10/91701.htm
How to Develop Sublime Text 2 plug-in http://www.linuxidc.com/Linux/2013-09/90046.htm
Install and crack Sublime Text 2 editor http://www.linuxidc.com/Linux/2013-08/89452.htm in Windows Mac Linux
Text Editor Sublime Text experience http://www.linuxidc.com/Linux/2013-08/89326.htm
Sublime Text: Click here
Sublime Text: Click here
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2016-01/127344.htm