Sublime Text 2 Plugin

Time:2021-8-9

Before Android development, eclipse was always used as the editor. After contacting ruby, I began to use sublime text 2. Gradually, I found the benefits of this editor and relied on it more and more.

Sublime text 2 is a lightweight, concise, efficient and cross platform editor. Its convenient color matching and compatible VIM shortcut keys have won the love of many front-end developers. I didn’t know it had so many plug-in extensions and support until Vincent asked if he was using the ctags plug-in. He didn’t know that sublime can also realize some large ide functions through plug-ins. So Google. This blog will introduce the plug-ins often used under sublime.

Package control

Open sublime text 2 and clickTools -> Command PaletteCall up the console;

Paste the following code into the command line 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;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())

Restart sublime text 2 ifPreferences -> Package SettingsIf you see the item package control in, the installation is successful.

Installing the alignment plug-in

For some programmers who like tidiness, it may be unbearable to see the following:

var joe = 'joe';
var johnny = 'johnny';
var quaid = 'quaid';

Be sure to change it to this way to be reassured:

var joe    = 'joe';
var johnny = 'johnny';
var quaid  = 'quaid';

In sublime text 2, a sublime alignment plug-in can also be easily implemented.

  1. Press Ctrl + Shift + P to call up the command panel.
  2. Enter install to call up the package control: install package option, and press enter.
  3. Find alignment in the list and press enter to install.
  4. Restart sublime text 2 for it to take effect. Now you can align by selecting the text and pressing Ctrl + Shift + a.

VIM mode

Yes, sublime text 2 already supports VIM’s editing mode. If you prefer VIM’s editing mode, you can activate the vintage mode through the following methods:

  1. Press Ctrl + Shift + P to call up the command panel.

  2. Enter settings user to call up preferences: settings – user and press enter.

  3. At this time, a file of preferences.sublime-settings will be opened. If it is modified for the first time, it should be an empty file. Paste the following text:

{
  "ignored_packages": []
}
  1. When saving this file, press ESC and then press some familiar VIM commands. Is it very friendly?

Install soda theme

The topic here is different from the color scheme for the code. It is the topic of the pointer to the sublime program itself. At present, Ian Hill’s soda can be installed.

Because it has been added to the source, the installation of this theme can also be through package control, which is very convenient. At present, soda theme provides light and dark styles.

To activate the method, also modify preferences: settings – user:

  1. Press Ctrl + Shift + P to call up the command panel.

  2. Enter user settings to call up preferences: settings – user and press enter.

  3. Add the following code to activate the soda light theme:

{
  "theme": "Soda Light.sublime-theme"
}

Add the following code to activate the soda dark theme:

{
  "theme": "Soda Dark.sublime-theme"
}

4. Effective upon deposit.

Installing the ctags plug-in

This plug-in can jump across files and realize the function of tracking functions like eclipse. From then on, I prefer sublime. Installation method:

  1. Press Ctrl + Shift + P to call up the command panel.
  2. Enter install to call up the package control: install package option, and press enter.
  3. Find ctags in the list and press enter to install.
  4. Install and run the command under Ubuntu: sudo apt get install exuberant ctags.
  5. Right click the sublime project folder, and the CTAG: rebuild tags menu will appear. Click it and the. Tags file will be generated.

Then in your code, place the cursor on a function and click Ctrl + Shift + left mouse button to jump to the place where the function is declared.

Zen Coding

If you often need to write some front-end code, this plug-in is also essential. Students who do not know zencoding recommend to take a look at Zen coding: a method to quickly write HTML / CSS code

Git

A plugin integrating GIT and sublime text executes many commands you need to use.