zoukankan      html  css  js  c++  java
  • Under ubuntu 12.04,install sublime text 2

    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:

  • 相关阅读:
    redis性能优化——生产中实际遇到的问题排查总结
    Redis优化经验
    Python 发送 email 的两种方式
    封装简单的equery
    Mobiscroll的介绍【一款兼容PC和移动设备的滑动插件】
    css3毛玻璃模糊效果
    环形进度条的实现方法总结和动态时钟绘制(CSS3、SVG、Canvas)
    CSS实现圆角,三角,五角星,五边形,爱心,12角星,8角星,圆,椭圆,圆圈,八卦
    盘点8种CSS实现垂直居中水平居中的绝对定位居中技术
    CSS 去掉inline-block间隙的几种方法
  • 原文地址:https://www.cnblogs.com/luomingchuan/p/3417921.html
Copyright © 2011-2022 走看看