My sublime text 2 Notes

Source: Internet
Author: User
Tags sublime text

As a loyal fan of Aptana, I recently started to use sublime due to work needs. For the first time I used it, it was started in seconds, with a simple interface design, this picture is displayed without interference.

As the saying goes, to do a good job, you must first sharpen the tool. As a code farmer, before coding, you must be familiar with your tools to get twice the result with half the effort.

Shortcut Key

As a code farmer, many times are typing on the keyboard, so the shortcut keys are very important. There are many sublime shortcuts, which are hard to remember. According to the 80/20 principle, only 20% is commonly used. Below are my commonly used shortcut keys:

Shortcut Key Function
CTRL + P Search for files in a project
CTRL + k, CTRL + B Switch the display status of the sidebar
CTRL + Shift + backspace Delete all on the left
CTRL + Y Redo or repeat
Shift + direction key Move and select
CTRL + [|] Indent | uncompress
CTRL + L Select rows. Duplicate rows can be added to select the next row.
CTRL + m Jump to brackets
Alt +. Close tag
CTRL + Shift + P Open Command Panel
CTRL + R Go to Method
CTRL + G To the nth line
CTRL +/ Switch the comment status of the current row
CTRL + Shift + [|] Collapse | expand (CODE)
CTRL + H Replace
Plug-ins

The sublime function has already met most of the requirements, but there are still some differentiated requirements that cannot be met. At this time, the sublime plug-in will come in handy. Let's take a look at my plug-ins first.

Because sublime 2 does not contain plug-ins, you must first install the plug-in Manager (package control), first open the console, click View-> show Console (or press Ctrl + ') on the menu bar of sublime ').

Now that the console is opened, there are two upper and lower columns in this console, the above column displays in real time What plug-ins are executed by sublime and the execution results. If a plug-in you have installed cannot run normally, check whether an error is reported here. The following is an input box for running Python code.

Enter the following code and press enter to run the package control.

import urllib2,os,hashlib; h = ‘7183a2d3e96f11eeadd761d777e62404‘ + ‘e330c659d4bb41d3bdf022e94cab3cd0‘; pf = ‘Package Control.sublime-package‘; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( ‘http://sublime.wbond.net/‘ + pf.replace(‘ ‘, ‘%20‘)).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), ‘wb‘ ).write(by) if dh == h else None; print(‘Error validating download (got %s instead of %s), please try manual install‘ % (dh, h) if dh != h else ‘Please restart Sublime Text to finish installation‘)

After running, restart the editor to view the package control in preferences.

Then press Ctrl + Shift + P. An input box is output to install, delete, and update the plug-in.

Less

This is a great plug-in. It enables sublime to support less syntax highlighting and syntax prompts. It is very important for less students, but it is explained more.

Emmet

The predecessor of Emmet is the famous Zen coding. If you are engaged in Web Front-end development, you will not be unfamiliar with this plug-in. It uses the syntax similar to the CSS selector to generate code, greatly improving the speed of HTML/CSS code writing.

  • Here is a demonstration article
  • Official Emmet website
Sublimelinter

Various syntax errors can be verified without much explanation.

Docblockr

Docblockr allows you to easily document code. It will parse functions, variables, and parameters and automatically generate a document paradigm based on them. Your job is to fill in the corresponding description.

Jsformat

The tool specifically used to format JS is very powerful.

Brackethighlighter

These symbols are paired with braces {}, braces [], Parentheses (), and quotation marks. When we move the cursor over the start symbol, we hope to clearly see where the end symbol is. The Sublime is underlined by default, which is not obvious. To be clear, we can install the plug-in brackethighlighter.

My sublime text 2 Notes

Related Article

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.