Sublime TEXT3 Use Summary

Source: Internet
Author: User
Tags phpinfo sublime text

Written in the previous words: usually do projects in the Eclipse and VS, but for some small projects, feel no need to engage in such a large tool use, such as writing a small micro-mall, make a small script what, so have been using sublime Text, the interface fresh and concise, There is no extra point of obsessive compulsive disorder users, so today is a simple summary of my use of the most used in the process of some of the tips, share to everyone.

===== Body begins =====

1.Sublime Text2 or Sublime Text 3?

Although the two use similar, but still use the latest version, although the beta version, but after all, there are some updates, such as the UI of some small changes, the installation of the package file is installed directly in the sublime Text3 folder, Instead of the other directories installed on the C drive , it is also a green version , and some configurations are also available for easy backup retention.

2.Sublime Text3 is the green version, how to add to the right-click menu, you can quickly use the Sublime Text3 open?

(1) cmd command run: regedit, open the registry.

(2) Locate Hkey_classess_root->*->shell, and create the new entry below, named Edit with Sublime Text3.

(3) Create a new string value under the item "Edit with Sublime text", named icon, with a value of "C:\Program files\sublime text Build 3065\sublime_text.exe, 0" , where the black address is the Sublime text program file address.

(4) Under the item "Edit with Sublime text", under the new command, the default value under this command is modified to "C:\Program files\sublime text Build 3065\sublime_ Text.exe, 1 ".

(5) After the setup is complete, you can display edit with Sublime Text3 in the right-click menu without restarting the computer.

3.Sublime TEXT3 Basic interface and other parameters set?

Sublime TEXT3 The default interface settings configuration file is preferences---->settings-default.

We can override the settings in Setting-default by adding values to the Settings-user configuration file, and format the values in the Setting-default configuration file, such as the font size I set below, Row highlighting and Sidebar folder icons bold. After the setup is complete, Ctrl+s saves without restarting the sublime Text3 to take effect immediately.

4.Sublime Text3 common shortcut keys?

There are many shortcut keys are consistent with the operating system, there are a lot of interesting other shortcut key operations, the default shortcut keys set in Preferences--->key bindings-default, which can be found in all the shortcut keys, the same can be in the key Bindings-user, reset the new value to override the default setting. is the two shortcut keys for my custom settings.

Here are some of the shortcut keys I used to summarize:

(1) Format code: ALT+SHIFT+F set itself, select the code and press this shortcut to format the code.

(2) Folding code: ctrl+shift+[Self-set, you can collapse the code inside the method, when a class file method is relatively long, you can use.

(3) Open the window just closed: ctrl+shift+t default settings.

(4) Full screen: F11 default settings.

(5) Do not Disturb full screen display: shift+f11 default settings, larger than the F11 display.

(6) Multiple places to choose the same word: ctrl+d, fallback select ctrl+u default settings, very useful, you can try.

(7) Cancel window display: ESC default settings, such as when we ctrl+f search, there will be a search box at the bottom, because you can not find the above to close the X, so press ESC, it is easy to close.

(8) Add a line to the code: Ctrl+shift+enter default Settings

(9) Move by Word: Ctrl + about the default settings, directly press the left and right key is a letter of the movement of a letter.

(10) Show class and method outlines: Ctrl+r default settings, it is easy to know which methods are in a class.

(11) Display n windows: alt+shift+1, or 2,3 ... displays n windows, such as when writing CSS, can be a window open HTML, a window open CSS

5.Sublime Text3 some interesting plugins?

Sublime Text3 has a lot of interesting plug-ins, can be convenient for our code, but plug-ins should not be flooded with, otherwise, it is better to use the IDE. To facilitate the installation and management of plug-ins, the first plug-in that should be installed, in fact, is the package management plug-in, packages control, so that after installing plug-ins more convenient.

(1) Package control plug-in installation:

1) Select the view--->show console on the sublime Text3 menu bar, and the console box appears at the bottom.

2) Enter the following code into the console box and press ENTER to wait for the installation to succeed.

    1. 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 ())
here is Method 2.
Import Urllib.request,os,hashlib; h = ' eb2297e1a458f27d836c04bb0cbaf282 ' + ' d0e7a3098092775ccb37ca9d6b2e4b7d '; PF = ' package control.sublime-package '; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); by = Urllib.request.urlopen (' http://packagecontrol.io/' + pf.replace (', '%20 ')). read (); DH = hashlib.sha256 (by). Hexdigest (); Print (' Error validating download (got%s instead of%s), please try manual install '% (DH, h)) if DH! = H Else Open (Os.pat H.join (IPP, PF), ' WB '). Write (by)

3) After the installation is successful, after installing other packages, press the shortcut key ctrl+shift+p directly, enter install, the package can be installed; Enter remove to remove the installed package.

(2) Folding status retention plug-in: Bufferscroll

We set the shortcut for the collapsed code, but each time we restart sublime Text3 or reopen the page, the collapsed state disappears and the code collapse State is preserved after the plugin is completed. Installation method is as follows: Press ctrl+shift+p--> input Install, select Install package--> input bufferscroll, installation can be.

6.Sublime TEXT3 Configure x-debug breakpoints debug PHP code?

Sublime Text3 write JS, CSS and HTML very useful, write PHP is also very comfortable, although debugging PHP with other software is better, but feel with habit Sublime Text3, so also find a way for it to set up debugging function, for debugging general Small project, enough. The setup steps are as follows:

(1) Configuring the X-debug plugin for PHP

1) Create a new PHP file, write a method phpinfo (), run it in the browser, right-view the source code, and copy the HTML code into the Clipboard.

2) Open the URL: http://xdebug.org/wizard.php, paste the previously copied HTML source code into the Web site text box, click Analyse my phpinfo () output.

3) According to the analysis results, install the appropriate X-debug plug-in until the installation is successful.

4) Modify the php.ini file to add a bit of code:

xdebug.remote_enable=1xdebug.remote_handler=dbgpxdebug.remote_host=127.0.0.1xdebug.remote_port= 9000xdebug.remote_log= "C:\Program Files\php\xdebuglog\xdebug.log"

Where Xdebug.remote_log configuration xdebug log file address, can be set to the address you want.

5) Restart Apache or other in-use Web Server.

At this point, the X-debug plugin was successfully configured for PHP.

(2) Configuring sublime Text3 X-debug Plug-in

1) Press ctrl+shift+p--> input Install, select Install package--> installation xdebug client.

2) Select Sublime Text3 menu bar: Tools--->xdebug--->settings--->user Custom setup debugging information, Settings---> Default is the Xdebug configuration file. (similar to sublime Text3 software, plugins also have their own default configuration files and profiles for user-defined settings)

3) Settings-user Configuration add configuration information as follows:

Where Launch_browser is set to True, the browser is opened when debugging, and Close_on_stop is set to True, you can close the unnecessary display of the debug window at the end of debugging, the URL sets the debug entry address, and when you press the Debug key, It jumps directly into the entry address.

At this point, you can use X-debug for debugging, but if you feel that using the Xdebug default shortcut keys is not convenient, then you can set the shortcut keys you want. The Setup method is shown below.

4) custom Debug shortcut keys

Since Xdebug does not have its own shortcut-key customization profile, we set it in the sublime Text3 software shortcut profile. Open the menu bar preferences--->key bindings-user, add the following code:

The shortcut keys are xdebug default, and you can change them to your favorite shortcuts, for example, with VS or Eclipse.

At this point, Sublime Text3 basic settings is good, set the same, go to peace of mind to write code it.

Http://www.cnblogs.com/wuguanglei/p/4286550.html

Sublime TEXT3 Use Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.