SublimeText2 is the best code editor I have ever used. It provides great UI and plug-in management, and is now available for free trial for an indefinite period of time, here, I will share with you how to install SublimeText2 in Ubuntu. if you need it, refer to the following tag: Ubuntu
1. download Sublime Text 2
Download the version corresponding to the number of digits of the system from the official website, extract the source code from the compressed package, and double-click "sublime_text" in the decompressed folder to run it directly.
2. create a shortcut
Copy the entire folder "Sublime" to the/opt directory, and then open the terminal and enter the following command to create a link for sublime_text:
Copy codeThe code is as follows:
Sudo ln-s/opt/Sublime/sublime_text/usr/bin/sublime
3. create a desktop shortcut
The next step is to create an application shortcut. enter the following in the terminal:
Sudo sublime/usr/share/applications/sublime. desktop
In the pop-up text editing window, enter:
Copy codeThe code is as follows:
[Desktop Entry]
Version = 1.0
Name = Sublime Text 2
GenericName = Text Editor
Exec = sublime
Terminal = false
Icon =/opt/Sublime/Icon/48 × 48/sublime_text.png
Type = Application
Categories = TextEditor; IDE; Development
X-Ayatana-Desktop-Shortcuts = NewWindow
[NewWindow Shortcut Group]
Name = New Window
Exec = sublime-n
TargetEnvironment = Unity
4. right-click to start
Enter:
Copy codeThe code is as follows:
Sudo gedit ~ /. Local/share/applications/mimeapps. list
Add the following to the last line:
Copy codeThe code is as follows:
Text/plain = sublime. desktop
Enter:
Copy codeThe code is as follows:
Sudo sublime/usr/share/applications/defaults. list
Search for gedit in the pop-up text. you can replace them with sublime. desktop, or copy each one containing gedit. the code line of the desktop, and then the gedit. replace desktop with sublime. desktop.
Then you can right-click open with sublime text 2 to open the text.
5. configure Sublime Text 2: Use Package Control to install the plug-in
Press Ctrl + 'to call up the console, paste the following code to the command line at the bottom, and press enter:
Copy codeThe code is as follows:
Import urllib2, OS; pf = 'package Control. sublime-package '; ipp = sublime. installed_packages_path (); OS. makedirs (ipp) if not OS. path. exists (ipp) else None; open (OS. path. join (ipp, pf), 'WB '). write (urllib2.urlopen ('http: // sublime.wbond.net/'{pf.replace ('', '% 20 ')). read ())
Restart Sublime Text 2. if you see package control in Perferences-> package settings, the installation is successful.
6. Use Package Control to install the plug-in
Press Ctrl + Shift + P to bring up the command panel, enter install to bring up the Install Package option, press enter, and select the plug-in to be installed in the list.