Install and configure Ubuntu sublime

Source: Internet
Author: User

Install sublime-text-2:

sudo add-apt-repository ppa:webupd8team/sublime-text-2sudo apt-get updatesudo apt-get install sublime-text

Third-party plug-in management:

Press Ctrl + '(the key on the left of 1) to bring up the command form and enter

import urllib2,os; 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())); open(os.path.join(ipp,pf),‘wb‘).write(urllib2.urlopen(‘http://sublime.wbond.net/‘+pf.replace(‘ ‘,‘%20‘)).read()); print(‘Please restart Sublime Text to finish installation‘)

Restart sublime

Press Ctrl + Shift + P to bring up the command form. Enter package control: Install package and press enter to view the third-party package. Select the desired package and click it to install it.


Install sublime-text-3 (recommended ):

Sudo add-Apt-repository PPA: webupd8team/sublime-text-3
Sudo apt-Get update
Sudo apt-Get install sublime-text-Installer


Sublime Text 3 enable package control (CTRL + 'preview cut or the View> show console)

import urllib.request,os,hashlib; h = ‘7183a2d3e96f11eeadd761d777e62404‘ + ‘e330c659d4bb41d3bdf022e94cab3cd0‘; 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://sublime.wbond.net/‘ + 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)


Frequently Used plug-ins:

1. format the CSS code.

Compact_expand_css_command

Select preferences> key bindings-user
Tian? For example, the following code:
{"Keys": ["Ctrl + super +]"], "command": "compact_expand_css", "ARGs": {"action": "Expand "}},
{"Keys": ["Ctrl + super + ["], "command": "compact_expand_css", "ARGs": {"action": "Compact "}}
Shortcut: Control + command + [or control + command +]


2 file folder tree on the left

Sidebarenhancements
In View> side bar> show open files, then hide tabs


3.html tag quick operations
Emmet
Tools> command palette> package control> enable package


4. js formatting plug-in
Jsformat
After formatting the JavaScript code, you can run cmd + Shift + P to find format: JavaScript.


5.html formatting
Tag
Select the area to be formatted. The shortcut key is CTRL + ALT + F. When HTML or XML is compiled, this plug-in can automatically close the opened tag.


6. Brackets matching in highlight Recognition
Bracket highlighter
Press preferences --> package settings --> bracket highlighter --> bracket settings-default to open a file
Change the style in "bracket_styles" to hightlight.


7. Code lines with highlighted errors
Sublimelinter


8. Arrange the variable neatly
Alignment
VaR A = 123; // The variable declared with VAR will be directed to it with (=.
VaR helloworld = 12334;

However, this plug-in uses Ctrl + cmd + A by default to conflict with the QQ that grabbed five global shortcuts, so you need to change the shortcut keys of the plug-in. choose preferences> keybindings> User? For example

{"Keys": ["Super + CTRL + ALT +]"], "command": "alignment "}

Change the shortcut key to Ctrl + opt + cmd +]. Change the shortcut key to any other one.


9 jquery's own active functions and word prompts and completion
Jquery
Tab


10. debug JavaScript code
Web Inspector


11 Windows laptop format support
"Converttoutf8" and "GBK encoding support" or "ecoding helping" may encounter conflicts between the two plug-ins on Mac computers. Disable converttoutf8 and enable it to resolve the conflict.


12 color extraction plug-in

Colorpicker: supports color selection (Windows, Mac, and UBUNTU) plug-ins on various platforms. Input cmd + Shift + C to enable it, which is quite easy to use.


13. manually check and write the File Content

Manually check the token to write the file content and switch to the correct language, such as gemfile => Ruby.


13. view the function definition.

Simply put, you can directly view the function definition in the Code, for example, the definition of a function or class. however, this plug-in cannot generate the ctags file on Mac, which seems to be a python issue.


14. Remotely edit files on the server

Copying textmate 2's rmate allows users to remotely edit files on the server. It should be quite helpful, but I haven't used to just column it here.


15 code prompt/self-completion/format check

Sublime codeintel


Attach the sublime Chinese Input solution under Ubuntu (including steps and tools)

Http://download.csdn.net/detail/qilixiang012/7256537

Http://justcoding.iteye.com/blog/1957613

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.