The Reindent_javascript skill of Sublimetext's self-formatted code function

Source: Internet
Author: User

This is the little sleep in just found a sublimetext in the format of the code, in fact, the format of the code is the function of the sublimetext itself, but has not been a small awareness excavation.

Before the small sleep for the format of the code are copied code, and then pasted into the Webmaster tools to format the code, but in the small sleep test the following sublimetext with the format of the code features, Xiao that this is a redundant step.

So, speaking of which, what should be done with Sublimetext's own formatted code function?

This feature is named Reindent by Sublimetext, and if you use the Sublimetext package, it's called "Indent again," but that doesn't make sense.

Path to this option: edit-line-reindent (Chinese path is: edit-line-indent again)

At the same time, this feature does not need to select the code to perform the formatting function, which by default is the format of the entire file code.

Next to the topic, how should the format of the code function to set the shortcut key combination?

1, first through the following path to open the user key binding file:

Preferences→key Bindings–user

2, and then add the following code (if you need it, the shortcut key combination can be defined by itself):

{"Keys": ["Ctrl+shift+r"], "command": "Reindent", "args": {"Single_line": false}}

Here, please note that each set of shortcut key combinations contains an inside bracket, defines a set of shortcuts through curly braces, and separates them by commas, which can be referenced in the following illustration:

Is this the end of the article here? No, Next, if Sublimetext's formatted code doesn't fit in the language you're using (such as SQL, Ruby, etc.), you can configure it in a plug-in way, see the following:

1, the following content based on already you have installed in your Sublimetext package control (tutorials in this site have);

2, through the shortcut key combination ctrl+shift+p call out the command panel

3, in the panel input "install package" after the carriage return

4, then enter the "format" (that is, formatted meaning), in the pop-up list to find the corresponding you want to format the operation of the language, specifically look at the picture:

The above content is a small series to introduce the Sublimetext with the format of the function of the reindent of all the narration, I hope you like.

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.