码迷,mamicode.com
首页 > 其他好文 > 详细

Sublime text 3安装svn插件

时间:2015-11-20 21:23:40      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:

这几天在研究sublime text 3的使用,感觉还不错,现在想让他能够支持svn,所以就写一下怎么安装svn插件吧~

首先先说一下这个官方的插件网站 点我进入~

进入之后,最上边的第一个就是点击安装插件包管理插件,有了这个插件才能够方便的安装别的插件.

首先通过ctrl+~唤出控制台

如果你是sublime text 3那么执行一下代码

1 import urllib.request,os,hashlib; h = ‘2deb499853c4371624f5a07e27c334aa‘ + ‘bf8c4e67d14fb0525ba4f89698a6d7e1‘; 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://packagecontrol.io/ + 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那么执行一下代码

1 import urllib2,os,hashlib; h = ‘2deb499853c4371624f5a07e27c334aa‘ + ‘bf8c4e67d14fb0525ba4f89698a6d7e1‘; 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://packagecontrol.io/ + 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 = ‘2deb499853c4371624f5a07e27c334aa‘ + ‘bf8c4e67d14fb0525ba4f89698a6d7e1‘; 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://packagecontrol.io/‘ + 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)
170998

注意最后的数值,这个表示下载的数据大小,此时你回车会看见

1 Package Control: No updated packages

之后需要ctrl+shift+p,然后输入

1 install

你就能看见下边显示出内容,选择Install Package

然后你会看见左下角有个=号在一直晃动,等待一下就会出来可以安装的包,此时你只需要输入svn

如果你的是windows的则选择,(需要提前安装TortoiseSVN,也就是我们说的小乌龟)

1 TortoiseSVN

如果是linux的则选择

1 SVN

此时左下角显示 Installing package TortoiseSVN或者Installing package SVN

我现在用的是windows的所以就以windows为例

下载完成之后会自动打开一个文件,文件内容如下

01 Package Control Messages
02 ========================
03  
04 TortoiseSVN:
05 -----------
06  
07   Sublime-TortoiseSVN
08   =============
09   sublime-TortoiseSVN is a tiny and simple plugin for [Sublime Text](http://www.sublimetext.com) .
10   It‘s behavior is similar to [subclipse](http://subclipse.tigris.org/) in [Eclipse](http://www.eclipse.org/).
11   **It runs only on Windows and needs the TortoiseSVN and TortoiseSVN command line tools (TortoiseProc.exe).**
12  
13   Usage
14   ============
15   Install it using [Sublime Package Control](http://wbond.net/sublime_packages/package_control).
16   If TortoiseSVN is not installed at `C:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe`, specify the correct path
17   by setting property "tortoiseproc_path" in your TortoiseSVN.sublime-settings file.
18  
19   The default key bindings are
20   - [alt+c] : commit current file.
21   - [alt+u] : update current file.
22   - [alt+r] : revert current file.
23  
24   You can also call TortoiseSVN commands when right-clicking folders or files in the side bar.
25  
26   IMPORTANT
27   ==============
28  
29   Do NOT edit the default Sublime-TortoiseSVN settings. Your changes will be lost
30   when Sublime-TortoiseSVN is updated. ALWAYS edit the user Sublime-TortoiseSVN settings
31   by selecting "Preferences->Package Settings->TortoiseSVN->Settings - User".
32   Note that individual settings you include in your user settings will **completely**
33   replace the corresponding default setting, so you must provide that setting in its entirety.
34  
35   Settings
36   ==============
37  
38   If your TortoiseProc.exe path is not the default, please modify the path by selecting
39   "Preferences->Package Settings->TortoiseSVN->Settings - User" in the menu.
40  
41   The default setting is:
42  
43     {
44           // Auto close update dialog when no errors, conflicts and merges
45           "autoCloseUpdateDialog": false,
46           "tortoiseproc_path": "C:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe"
47       }

里 边最重要的就是下边几句,说的是你要是默认安装的TortoiseSVN,则不需要更改直接可以使用,要是自定义的路径,则需要手动配置sublime text的svn插件路径,具体的配置文件在Preferences->Package Settings->TortoiseSVN->Settings - User

如我的路径是D:\SVN\bin\TortoiseProc.exe

则在刚才打开的配置文件里边输入一下内容

1 {
2     // Auto close update dialog when no errors, conflicts and merges
3     "autoCloseUpdateDialog": false,
4     "tortoiseproc_path": "D:\\SVN\\bin\\TortoiseProc.exe"
5 }

 注意,目录层之间用\\分割而不是\分割哦~

现在你再试试在你左侧栏中右键是不是能看见svn的操作选项了呀.

 

 

转载自:http://www.bbtang.info/script/853.html

Sublime text 3安装svn插件

标签:

原文地址:http://www.cnblogs.com/jxkshu/p/4982170.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!