Sublime Text 3 usage Summary

Source: Internet
Author: User

Sublime Text 3 usage Summary

Preface: eclipse and vs are usually used in projects. However, for small projects, it is not necessary to use such a large tool, such as creating a small and micro Mall, I have been using Sublime Text because I have made a little script. The interface is fresh and concise, and there are no redundant points that make obsessive-compulsive users crazy, so today I will briefly summarize some of the tips I have used most in my use and share them with you.

Install the Sublime Text 3 (Build 3065) Text Editor in Ubuntu

===== Body start =====

1. Sublime Text2 or Sublime Text 3?

Although the two are similar in use, we recommend using the latest version. Although it is beta, there have been some updates, such as some minor changes in the UI, the installed package file is directly installed in the sublime text3 folder, instead of other directories on the C drive. It is also a green version, and some configurations can be easily backed up and retained.

2. Sublime Text3 is a green version. How can I add it to the right-click menu and use Sublime Text3 to open it quickly?

(1) Run regedit In the cmd command to open the registry.

(2) locate HKEY_CLASSESS_ROOT-> *-> Shell, and create a new item named Edit with Sublime Text3.

(3) create a new string value under the item "Edit with Sublime Text" and name it an Icon. The value is "C: \ Program Files \ Sublime Text Build 3065 \ sublime_text.exe, 0 ", the black address is the address of the Sublime Text program file.

(4) create a new Command under the item "Edit with Sublime Text". The default value of this Command item is changed to "C: \ Program Files \ Sublime Text Build 3065 \ sublime_text.exe, 1 ".

(5) After the settings are complete, you can right-click the computer and choose Edit with Sublime Text3 from the shortcut menu.

3. How do I set parameters such as Sublime Text3 basic interface?

Set the configuration file in Preferences ----> Settings-Default on the Sublime Text3 Default Interface.

We can overwrite the value set in Setting-Default by adding value in the Settings-User configuration file. For the format of the value set, see Settings in the Setting-Default configuration file, for example, the font size, line highlight, and sidebar folder icons I set below are bold. After the settings are complete, press Ctrl + S to save the settings. You do not need to restart Sublime Text3 to apply the settings immediately.

4. What are common Sublime Text3 shortcut keys?

There are many shortcut keys that are consistent with the operating system, and there are many interesting other shortcut keys. The Default shortcut keys are set in Preferences ---> Key Bindings-Default, you can find all the shortcut keys. You can also reset the new value in Key Bindings-User to overwrite the default setting. These are two shortcut keys for custom settings.

Some of my frequently used shortcut keys are summarized as follows:

(1) format the code: alt + shift + f. You can select the code and press the shortcut key to format the code.

(2) folding code: ctrl + shift + [you can fold the code in the method. When there are many methods in a class file, you can use them.

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

(4) full screen display: F11 is set by default.

(5) do not disturb full screen display: Shift + F11 default settings, larger than F11 display.

(6) Select the same word in multiple places: Ctrl + D, and press Ctrl + U to return to the default setting. It is very useful. You can try it.

(7) Cancel window display: ESC default settings, for example, when we press Ctrl + F to search, there will be a search box at the bottom, because the above cannot be found to close ×, so Press ESC, it can be easily disabled.

(8) Add a new line in the Code: Ctrl + shift + Enter default settings

(9) Move words by word: Ctrl + left and right keys are set by default. Directly press the left and right keys to move one letter and one letter.

(10) display class and method outline: Ctrl + R default settings, you can easily know which methods are available in a class.

(11) show n windows: alt + shift + 1, or 2, 3... display n windows. For example, when writing css, you can open html in one window and css in one window.

5. What are some interesting extensions of Sublime Text3?

Sublime Text3 has many interesting plug-ins, which can facilitate our coding, but the plug-ins should not be used in a flood of ways. Otherwise, it would be better to use IDE. To facilitate plug-in installation and management, the first plug-in to be installed is the Package management plug-in and Package Control, which makes it much easier to install the plug-in later.

(1) Package Control plug-in installation:

1) select View ---> Show Console in the Sublime Text3 menu bar, And the Console box appears at the bottom.

2) enter the following code in the Console box and press Enter. Wait until the installation is successful.

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.path.join( ipp, pf), 'wb' ).write(by)

3) after the installation is successful, install another package. Press the shortcut key Ctrl + Shift + P, enter install to install the package, and enter remove to delete the installed package.

 

(2) folding status retention plug-in: BufferScroll

Previously we set the code folding shortcut, but each time we restart Sublime Text3 or re-open the page, the folding status disappears. After the plug-in is installed, the Code folding status will be retained. The installation method is as follows: press Ctrl + Shift + P --> enter install, select Install Package --> enter BufferScroll to install.

6. How does Sublime Text3 configure X-debug breakpoint debugging PHP code?

Sublime Text3 is quite useful for writing js, css, and html. It is also very comfortable to write php. Although it is better to debug PHP with other software, I feel used to Sublime Text3, therefore, it is sufficient to configure the debugging function for a small project. The procedure is as follows:

(1) configure the x-debug plug-in for PHP

1) create a PHP file, write a method phpinfo (), run it in the browser, right-click to view the source code, and copy the html code to the clipboard.

 

2) visit http://xdebug.org/wizard.php, paste the source code copied in the previous step to the website, and click analyse my phpinfo () output.

3) install the appropriate x-debug plug-in according to the analysis results until the installation is successful.

4) modify the php. ini file and add the following 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"

Xdebug. remote_log configures the xdebug log file address, which can be set to the desired address.

5) Restart Apache or other Web servers in use.

So far, the x-debug plug-in is successfully configured for php.

Animation display 16 Sublime Text Shortcut Key Usage

Ubuntu 12.10 install and crack Sublime Text 2

Install Sublime Text 2 on Ubuntu 13.04

Code artifact-Sublime Text package management tools and extensions

How to Develop the Sublime Text 2 plug-in

Install and crack the Sublime Text 2 editor in Windows Mac Linux

Text Editor Sublime Text User Experience

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.