汉化Sublime Text3

Sublime Text是一款非常好用的编辑器,而且跨平台,几乎是现在程序员圈子里评价最高的编辑器了。但是Sublime Text不像Notapad++,它是没有中文版的,虽然平时英文版也能用,但是毕竟自己英文还是有点烂,看起总觉得有点别扭。所以,这逼死装不了了。

前些天,工作不是很忙,于是就偷空用自己蹩脚的英文把Sublime Text3给简单汉化了一下,放在了github上Chinese For Sublime Text,大致也还算可以。本来是放了截图的,可是天朝网络太imba,老显不出来,索性就不放了。

其实汉化步骤很简单,不管是哪个版本的Sublime Text,都可以按照这个步骤进行汉化。具体步骤是

  • 进入到Sublime Text安装目录的Packages文件夹下,如:C:\Program Files\Sublime Text 3\Packages;

  • 将Default.sublime-package复制后备份,然后zip打开Default.sublime-package,解出来这个包里后缀为menu的的文件;

  • 将目之所见的caption值由英文修改中文或者对应按钮添加中文的caption值即可。

Sublime Text同样不有很强的定制性,有很多很有用的插件,这里20 个强大的 Sublime Text 插件Sublime Text 3能用支持的插件推荐介绍的分享的插件都很不错,值得一试。这里介绍了如何安装Package Control.sublime-package,通过Package Control.sublime-package可以非常方便地安装很多插件。

1
2
3
4
5
6
7
8
9
10
11
12
The simplest method of installation is through the Sublime Text console. The console is accessed via the ctrl+` shortcut or the View > Show Console menu. Once open, paste the appropriate Python code for your version of Sublime Text into the console.

SUBLIME TEXT 3

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)


SUBLIME TEXT 2

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

This code creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it. The download will be done over HTTP instead of HTTPS due to Python standard library limitations, however the file will be validated using SHA-256.