Home > Article > Development Tools > How to use Sublime? Introduction and use of Sublime
The following column sublime tutorial will introduce how to use Sublime, so that everyone can understand what Sublime is and how to use Sublime. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Sublime Introduction
Sublime Text is a code editor and an advanced text editor for HTML and prose. Sublime Text was developed by programmer Jon Skinner in January 2008. It was originally designed as a Vim with rich extension functions.
Sublime installation
is very simple, just download the corresponding system version from the official website. There is a problem. The official website seems to be very unfriendly to mainland Internet users. It is inaccessible, so you have to manually laugh. After installation, it is actually a trial version installed. How to crack:
Enter license:
—– BEGIN LICENSE —– TwitterInc 200 User License EA7E-890007 1D77F72E 390CDD93 4DCBA022 FAF60790 61AA12C0 A37081C5 D0316412 4584D136 94D7F7D4 95BC8C1C 527DA828 560BB037 D1EDDD8C AE7B379F 50C9D69D B35179EF 2FE898C4 8E4277A8 555CE714 E1FB0E43 D5D52613 C3D12E98 BC49967F 7652EED2 9D2D2E61 67610860 6D338B72 5CF95C69 E36B85CC 84991F19 7575D828 470A92AB
As mentioned above, the power of sublime’s plug-ins is mentioned. Sublime uses package control to uniformly manage installed plug-ins. It seems that the newer version of sublime 3 comes with the package control function by default after activation, so there is no need to install it yourself. In fact, it is very simple to install the package control function:
Open view-show console, open a terminal window similar to terminal, enter the following content to install package control:
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener(urllib.request.build_opener( urllib.request.ProxyHandler()));open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
After the installation is completed, close sublime, restart. The shortcut key command shift p brings up the small plug-in installation window, click install package, enter the plug-in you want to install, such as gist, and press Enter.
Chinese font display is abnormal
As shown below, sublime text Chinese display is abnormal:
Looks uncomfortable.
Solution: Change fonts. Programmers all have their own fonts. Personally, I prefer Yahei Consolas Hybrid. It is obviously a mixture of two fonts. It is synthesized from Microsoft Yahei’s Chinese font and Consolas’ English font. Consolas Font is a font developed by Microsoft specifically for programmers.
Setting method: preference——settings, open a json file, add k-v key-value pair:
"font_face":"Yahei Consolas Hybrid"
First make sure you have this font installed on your computer. Download address: http://cloud.alphadn.com/blog/yahei-consolas.zip.
Basic functions
Sublime already has its own code formatting function: Edit -> Line -> Reindent.
The built-in code formatting tool sometimes feels insufficient. For json or xml file content, if you want to see the formatted directory level display content at a glance, you can also install a plug-in, such as indent xml. Sometimes some plug-ins cannot be found in package control. In this case, another way to install the plug-in is needed, by entering the plug-in address. See below for details.
Must-have shortcut keys
sublime installation plantUML tool
PlantUML is a tool for quickly creating UML Graphical components, often used in the design and development of UML diagrams. Whether it is a Mac or Windows platform, to use the drawing function of plantUML, you need to install graphviz first. For the Mac platform, it can be done with one command:
brew install graphviz
Because in sublime's default package manager repository (?), package control Plantuml cannot be found in it, so you need to enter the configuration source yourself (the concepts are all interoperable, similar to npm?).
Steps:
Shortcut key command shift p, enter add repository, find Package Control:Add Repository, enter https://github.com/jvantuyl in the input box that appears below /sublime_diagram_plugin.git, then press Enter and wait for the installation to complete, then restart.
The installation is completed. For a UML text (that is, the text contained between @startuml and @enduml), the shortcut key command m can call up the graphviz renderer to complete the identification and rendering of the text content. Finally drawing. So here’s the problem. The command m shortcut key is the minimized shortcut key on the Mac platform by default.
How to change the shortcut key mapping?
Open Preferences -> Key Binding - User, add a shortcut key:
{"keys":["command+d"],"command":"display_diagrams"}
Configure to hold down Alt d to generate a PlantUML image.
sublime Install a simple go language development environment
Thanks to the popularity of cloud computing, the go language has shined. I’m not sure what the best go language development environment IDE is. After all, I’m not a go language developer. I just debug small projects in my spare time. intellij IDEA performs well, I don’t know about others.
Of course, sublime can also build a go language development environment, but its functions are relatively limited.
sublime text comparison function
In work, it is inevitable to compare the differences between two texts. For simple text comparison, you can use online tools,https://www.diffchecker.com/. For complex text comparisons of large-scale projects involving more than a dozen files, folders as deep as three or four levels, and hundreds or even thousands of files, online tools are obviously not up to the task. I think beyond compare is the best text comparison tool.
The above is the detailed content of How to use Sublime? Introduction and use of Sublime. For more information, please follow other related articles on the PHP Chinese website!