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. angularjs1-4 事件指令

    <div ng-app="myApp"> <div ng-controller="firstController"> <div n ...

  2. 使用神经网络-垃圾邮件检测-LSTM或者CNN(一维卷积)效果都不错【代码有问题,pass】

    from sklearn.feature_extraction.text import CountVectorizer import os from sklearn.naive_bayes impor ...

  3. 给centos重新安装yum的base-repo源

    转自:https://blog.csdn.net/lovemysea/article/details/79552952 如果自己的centos的系统yum源出现问题了,如何才能修复? 方式一:使用国内 ...

  4. 踩坑 Windows 解决pip install出现“由于目标计算机积极拒绝,无法连接”的问题

    解决pip install出现“由于目标计算机积极拒绝,无法连接”的问题   可能是使用某软件自动设置了代理, 所以需要手动的取消代理才可以.   在Intel选项中把所有的代理都给去掉就可以了... ...

  5. ubuntu下谷歌浏览器字体模糊解决方案

    一般来说,这种问题应该是缺少字体造成的,因此重新安装字体就可以解决问题. 1.双系统下,查找Windows C盘下:Windows/font/???? ???可在3中查找相应字体 2.分别双击安装那两 ...

  6. Core Java(五)

    类和对象&方法 ——类的定义 现实世界的事物 属性:人的身高,体重等 行为:人可以学习,吃饭等 Java中用class描述事物也是如此 成员变量:就是事物的属性 成员方法:就是事物的行为    ...

  7. (转载)Android快速开发偷懒必备,一句话搞定所有ViewGroup的Adapter . 支持自定义ViewGroup

    [置顶] [Android]快速开发偷懒必备,一句话搞定所有ViewGroup的Adapter . 支持自定义ViewGroup 标签: androidAdapter快速开发0耦合 2016-12-1 ...

  8. Android和IOS等效MD5加密

    最近在Android和IOS上都需要对用户的某些输入进行简单的加密,于是采用MD5加密方式. 首先将目的字符串加密一次,获得32位字符串 然后将32位字符串拆为2段,分别加密1次 最后将加密后的2段拼 ...

  9. jquery的animate能渐变background-color

    在freecodecamp 上学习复习时,写了一个demo,引用了 jquery 实现 color 的渐变动画,然后运行测试的时候,发现其他功能都正常,就是无法是实现颜色的动画. 如: $('butt ...

  10. 第十三章 Python并发编程

    并发编程之多进程 python中如果想要充分的利用多核CPU的资源,大部分情况需要使用多进程,python提供了multiprocessing multiprocessing模块用来开启子进程,并在子 ...