这几天在研究sublime text 3的使用,感觉还不错,现在想让他能够支持svn,所以就写一下怎么安装svn插件吧~
首先先说一下这个官方的插件网站 点我进入~
进入之后,最上边的第一个就是点击安装插件包管理插件,有了这个插件才能够方便的安装别的插件.
首先通过ctrl+~唤出控制台
如果你是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')
我的是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)132375
注意最后的数值,这个表示下载的数据大小,此时你回车会看见
Package Control: No updated packages
之后需要ctrl+shift+p,然后输入
install
你就能看见下边显示出内容,选择Install Package
然后你会看见左下角有个=号在一直晃动,等待一下就会出来可以安装的包,此时你只需要输入svn
如果你的是windows的则选择,(需要提前安装TortoiseSVN,也就是我们说的小乌龟)
TortoiseSVN
如果是linux的则选择
SVN
此时左下角显示 Installing package TortoiseSVN或者Installing package SVN
我现在用的是windows的所以就以windows为例
下载完成之后会自动打开一个文件,文件内容如下
Package Control Messages========================TortoiseSVN:----------- Sublime-TortoiseSVN ============= sublime-TortoiseSVN is a tiny and simple plugin for [Sublime Text](http://www.sublimetext.com) . It's behavior is similar to [subclipse](http://subclipse.tigris.org/) in [Eclipse](http://www.eclipse.org/). **It runs only on Windows and needs the TortoiseSVN and TortoiseSVN command line tools (TortoiseProc.exe).** Usage ============ Install it using [Sublime Package Control](http://wbond.net/sublime_packages/package_control). If TortoiseSVN is not installed at `C:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe`, specify the correct path by setting property "tortoiseproc_path" in your TortoiseSVN.sublime-settings file. The default key bindings are - [alt+c] : commit current file. - [alt+u] : update current file. - [alt+r] : revert current file. You can also call TortoiseSVN commands when right-clicking folders or files in the side bar. IMPORTANT ============== Do NOT edit the default Sublime-TortoiseSVN settings. Your changes will be lost when Sublime-TortoiseSVN is updated. ALWAYS edit the user Sublime-TortoiseSVN settings by selecting "Preferences->Package Settings->TortoiseSVN->Settings - User". Note that individual settings you include in your user settings will **completely** replace the corresponding default setting, so you must provide that setting in its entirety. Settings ============== If your TortoiseProc.exe path is not the default, please modify the path by selecting "Preferences->Package Settings->TortoiseSVN->Settings - User" in the menu. The default setting is: { // Auto close update dialog when no errors, conflicts and merges "autoCloseUpdateDialog": false, "tortoiseproc_path": "C:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe" }
里边最重要的就是下边几句,说的是你要是默认安装的TortoiseSVN,则不需要更改直接可以使用,要是自定义的路径,则需要手动配置sublime text的svn插件路径,具体的配置文件在Preferences->Package Settings->TortoiseSVN->Settings - User
如我的路径是D:\SVN\bin\TortoiseProc.exe
则在刚才打开的配置文件里边输入一下内容
{// Auto close update dialog when no errors, conflicts and merges"autoCloseUpdateDialog": false,"tortoiseproc_path": "D:\\SVN\\bin\\TortoiseProc.exe"}
注意,目录层之间用\\分割而不是\分割哦~
现在你再试试在你左侧栏中右键是不是能看见svn的操作选项了呀.
本文固定链接:http://www.bbtang.info/script/853.html 原文链接:Sublime text 3安装svn插件,转发请注明来源!