Sublime Text is an awesome text editor. If you’ve never heard of it, you should check it out right now.

I’ve made this tutorial because there’s no installer for the Linux versions of Sublime Text. While that’s not a real problem, I feel there is a cleaner way to go around this. Also, this post will show you how to integrate Sublime Text to Unity (which, I’m glad to report, has now matured into a fully functional user interface).

So let’s get on with this. Here is my how to install Sublime Text on Ubuntu tutorial.

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.0.1\ 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. Like the “/opt/” folder :

1.sudo mv Sublime\ Text\ 2 /opt/

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 /opt/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=/opt/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.

Here are some screenshots:

Under ubuntu 12.04,install sublime text 2的更多相关文章

  1. 新装ubuntu 12.04 , 使用技巧

    *********************************************** 一.让Ubuntu 12.04开机默认进入命令行模式. 修改 /etc/default/grubGRUB ...

  2. Linux/Ubuntu 16.04 安装编辑器 Sublime Text 3

    在ubuntu 16.04 系统上使用Sublime Text 3 编辑文本还是不错的, 先到官网下载安装包,链接:http://www.sublimetext.com/3 ,下载对应的版本,64位或 ...

  3. Ubuntu 16.04下指定Sublime Text 3 默认python编译版本

    安装PackageResourceViewer插件 输入 Ctrl+Shift+P 输入install,选择Package Control: Install Package 选择PackageReso ...

  4. Ubuntu 16.04下安装sublime Text的插件

    Sublime Text是什么: 它是一款具有代码高亮.语法提示.自动完成且反应快速的编辑器软件,不仅具有华丽的界面,还支持插件扩展机制,用她来写代码,绝对是一种享受.相比于难于上手的Vim,浮肿沉重 ...

  5. ubuntu 14.04 下试用Sublime Text 3

    很多源代码都没有IDE支持的,尤其是开源的源代码.从github上下载的,很多也不用IDE.包括我自己公司的代码,基本都是脚本,也不用IDE.通常情况下,都是用notepad++.UE之类的文本编辑器 ...

  6. [置顶] 关于UBUNTU 12.04, 在THINKPAD E430C上WIFI连接不上的问题

    今天,把自己的本本给格式化了,化分成两个大块,在一切都搞定了后,出现了一个问题,即WIFI连接不上,但可以搜索到WIFI的网络,开始以为自己手贱,是不是密码输入了,试了N多次,发现偶错了,不是手贱,看 ...

  7. 【菜鸟学习Linux】-第三章- Linux环境搭建-使用VMware9安装Ubuntu 12.04系统

    上一步,我们安装了VMware9虚拟机,现在我们就是用它来安装Ubuntu12.04系统,至于Ubuntu是什么,我就不废话了,大家google一下,比我讲的清楚,好了,开始干活! Ubuntu官网下 ...

  8. Android 手机上安装并运行 Ubuntu 12.04

    ubuntu.sh脚本的原地址变动了,导致下载不了,现在更新了网盘地址.小技巧:遇到一些下载失效的时候可以试一试p2p下载工具(如 easyMule.迅雷等)试一试,说不定有人分享过~* —————— ...

  9. Windows XP硬盘安装Ubuntu 12.04双系统图文详解

    Windows XP硬盘安装Ubuntu 12.04双系统图文详解 Ubuntu 12.04 LTS版本于2012年4月26日发布,趁着五一放假,赶紧在自己的Windows XP的电脑上安装下Ubun ...

随机推荐

  1. oracle 11gR2 如何修改scan vip 地址 /etc/hosts方式

    这次帮客户搭建了一套oracle 11gR2 rac for aix环境,scan vip因为网络调整需要,需要更改以前设置好的scan vip,是采用/etc/hosts的方式,比如将scan vi ...

  2. Regexp-Utils:基本

    ylbtech-Regexp-Utils:基本 1.返回顶部 1. /** * 管理 */ var utils = { hostUrl: "http://localhost:8023&quo ...

  3. Redis常用的命令

    常规命令查询地址: http://redisdoc.com/ 如下图:

  4. 用过的jQuery记录

    var list= $('input:radio[name="name"]:checked').val(); //选择input中单选name为“name”的并且是选中状态的 in ...

  5. Java二维码生成与解码工具Zxing使用

    Zxing是Google研发的一款非常好用的开放源代码的二维码生成工具,目前源码托管在github上,源码地址: https://github.com/zxing/zxing 可以看到Zxing库有很 ...

  6. PHP单词表

    输出语句printechovar_dumpprint_rprintf变量的操作unset预定义变量$_SERVER$_GET$_POST$_REQUEST$_COOKIE,$_SESSION 会话技术 ...

  7. 省选模板_STL

    目录: 1. multiset 2. reverse 1.multiset namespace STL{ int main(){ multiset<int>::iterator s; mu ...

  8. scrollBot滚动条美化,niceScroll有滚动条错位得问题

    http://www.htmleaf.com/Demo/201706204585.html

  9. 浅谈冒烟测试(Smoke Testing)

    鉴于之前跟开发提到提测前需要进行冒烟测试,然后几个开发一脸迷茫的问我:什么叫冒烟测试?所以我准备跟大家从以下几个方面简单的分享一下什么是冒烟测试. 一.软件测试的分类 二.冒烟测试(Smoke Tes ...

  10. HDU 1002 A + B Problem II( 高精度加法水 )

    链接:传送门 题意:A + B 高精度,板子题 /************************************************************************* & ...