注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

onefish资料库

成功要素---耐得住孤独!

 
 
 

日志

 
 

非常专业的文本编辑器 sublimetext2  

2012-08-02 22:46:38|  分类: 技巧 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
http://www.sublimetext.com/2
Ubuntu 12安装方法

Step 1

Download the tarfile that suits you best and extract it. Here’s the command to extract tar.bz2 files:

1.tar xf Sublime\ Text\ 2\ Build\ 2181\ x64.tar.bz2

You’ll notice that I got the 64-bit version. The reason is that it’s lightning fast. So, go for that if you can!

Step 2

You’ll get a “Sublime Text 2″ folder after extraction. This folder contains all the files that Sublime Text will need. So we have to move that folder somewhere more appropriate. Yep “/usr/lib/” it is:

1.sudo mv Sublime\ Text\ 2 /usr/lib/

Step 3

At some point you’d want to be able to call Sublime Text from the Terminal by just typing “sublime”. To do that, we’ll just create a symbolic link in “/usr/bin” like thus:

1.sudo ln -s /usr/lib/Sublime\ Text\ 2/sublime_text /usr/bin/sublime

Step 4

Now that our files are at the right place, we need to create a launcher in Unity. To do this, we’re going to create a .desktop file in “/usr/share/applications”:

1.sudo sublime /usr/share/applications/sublime.desktop

And paste the following content:

01.[Desktop Entry]
02.Version=1.0
03.Name=Sublime Text 2
04.# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
05.# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
06.GenericName=Text Editor
07. 
08.Exec=sublime
09.Terminal=false
10.Icon=/usr/lib/Sublime Text 2/Icon/48x48/sublime_text.png
11.Type=Application
12.Categories=TextEditor;IDE;Development
13.X-Ayatana-Desktop-Shortcuts=NewWindow
14. 
15.[NewWindow Shortcut Group]
16.Name=New Window
17.Exec=sublime -n
18.TargetEnvironment=Unity

As you can see, these lines are quite straightforward. Go ahead and experiment a bit with them.

Step 5

Now you would probably want to open all text files with Sublime Text 2. The easiest way to do that is to open up the file associations list:

1.sudo sublime /usr/share/applications/defaults.list

And replace all occurrences of gedit.desktop with sublime.desktop.

Tada ! There you go. You now have Sublime Text 2 installed on Unity on Ubuntu 12.04, like a pro.

  评论这张
 
阅读(119)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018