星期五, 十一月 11, 2011

Sublime Text 2:编辑器新秀


主页:http://www.sublimetext.com

跨平台:windows / Linux / Mac OS

插件采用python语言开发,目前主程序和插件开发进展很快,目前已经足以作为一个强大的脚本开发 / Web开发 IDE 。

插件包控制 Sublime Package Control

按Ctrl+` 启动Sublime Text 2 console,输入如下回车安装package manager

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())

推荐插件

python类

1. 代码导航


I) Sublime Code Intel 插件提供代码补全与函数跳转功能。

    Code intelligence plugin ported from Open Komodo Editor to the Sublime Text 2 editor.

    Supports all the languages Komodo Editor supports for Code Intelligence (CIX, CodeIntel2): PHP, Python, RHTML, JavaScript, Smarty, Mason, Node.js, XBL, Tcl, HTML, HTML5, TemplateToolkit, XUL, Django, Perl, Ruby, Python3.

II)SublimeRope: Python Completion and GotoDefinition plugin using Rope


2. 代码检查 Python PEP-8 and PyFlakes checker


 
I) SublimeLinter

II) sublimetext_python_checker

This project is a plugin for SublimeText 2 text editor. It checks all python files you opening and editing through two popular Python checkers - pep8 and PyFlakes.

https://github.com/vorushin/sublimetext_python_checker

代码中使用个某个函数却忘记import 相应模块怎么办?python 中的模块 mr.igor 可以自动添加 import 语句。这个 Sublime Text 2 插件可以让它在 Sublime Text 2 工作。

Package Control Add URL https://github.com/optilude/SublimeTextIgorPlugi


Ruby

https://github.com/maltize/sublime-text-2-ruby-tests

https://github.com/SublimeText/RSpec

Sublime Guard

C/C++

CTags/Cscope 经典

clang (C/C++/Objective-C/Objective-C++) autocomplete http://github.com/quarnster/SublimeClang


Web Dev

Zen Coding

    Zen Coding is an editor plugin for high-speed HTML coding and editing. The core of this plugin is a powerful abbreviation engine which allows you to expand expressions—similar to CSS selectors—into HTML code.


    This is a great plugin when you’re working with a lot of markup. Tag is a collection of packages about, predictably, tags, mixed together in an effort to provide a single package with utilities to work with tags. Close a tag on a slash and tag indenting? Sign me up!


    This plugin collection includes plugins to fold your code according to brackts, cycle through selecting tags and many more.


    And where will all us be without jQuery? This is a Sublime Text bundle to help with jQuery functions.


    JsFormat is a javascipt formatting plugin for Sublime Text 2. It uses the commandline/python-module javascript formatter from JS Beautifier to format the selected text, or the entire file if there is no selection.


    It’s a good practice to always minify your files during deploying to a production server. And this plugin will swiftly automate the process by minifying your JavaScript using the Google Closure Compiler or UglifyJS compilers.
 
JsLint可由 SublimeLinter 插件实现


    DocBlockr is a Sublime Text 2 package which makes writing JSDoc comments and PHPDoc comments a breeze.


    A plugin that runs CSS through the Prefixr API, written by our very own Jeffrey Way, for Sublime Text 2.


    Tired of constantly having to manually convert your colors’ hexcodes to HSL? This plugin will automatically do it for you with the press of a button. Well, ok, three buttons. [Shift+Ctrl+U]

4. General Program
版本管理 sublime_tortoise / Git


    I’m quite a stickler for properly formatted code. One thing to get right is lining up all those darn variable assignment so they look all organized and neat. With this plugin, all it takes is the press of key. A simple key-binding allows you align multi-line and multiple selections.

SublimeREPL

    Run your favorite interpreter [python, ruby, lua, prolog :)] or Telnet session to an external tool (MozRepl) inside a Sublime buffer.


    DetectSyntax is a plugin for Sublime Text 2 that allows you to detect the syntax of files that might not otherwise be detected properly. This is specially helpful when you run into custom file formats — files used in templating is an excellent example.


    Case conversion is a plugin for Sublime Text 2. It converts the current word/token between pascal, camel, and snake case.

5. Others

EncodingHelper 编码转换

sublime-gbk

RegReplace Plugin

SublimeFileTemplates

SFTP 远程开发

HexViewer

SideBarEnhancements

Tips

1. vim模式

Preferences/Global Settings – Default

"ignored_packages": ["Vintage"] --> "ignored_packages": []

or try this plugin: https://github.com/SublimeText/VintageEx

2. 设置字体

Preferences > File Settings – User

{
"font_face": "Meslo LG S DZ",
"font_size": 10,
}

3. Fuzzy Finder (Go to Anything)

CTRL+P (fuzzy finder)

4. Multi Selection: awesome

按住Ctrl,选择吧

You Can Still Use TextMate Bundles

TextMate snippets and themes port over nicely to Sublime Text. You only need to drop them in the Packages folder — .tmbundle extension intact, and Sublime will recognize the files. This means that the entire catalog of TextMate themes will work in Sublime!

参考:

1 条评论:

Unknown 说...

请问一下,sublimetext的主程序是python开发的还是C/C++一类的语言开发的?