sublime text

从源码安装 sublimetext 2

进行解压,并把解压包放到/opt:

$ mv /home/lord63/Downloads/Sublime_Text_2/ /opt/Sublime_Text_2
$ sudo touch /usr/bin/sublime
$ sudo chmod 755 /usr/bin/sublime
$ sudo vim /usr/bin/sublime

粘帖以下内容

1
2
3
4
#!/bin/sh
export SUBLIME_HOME="/opt/Sublime_Text_2"

$SUBLIME_HOME/sublime_text $*

$ sudo vim /usr/share/applications/sublime.desktop

粘帖以下内容:

[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime_Text_2
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/Sublime_Text_2/sublime_text %F
Terminal=false
MimeType=text/plain;
Icon=/opt/Sublime_Text_2/Icon/48x48/sublime_text.png
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;

[Desktop Action Window]
Name=New Window
Exec=/opt/Sublime_Text_2/sublime_text -n
OnlyShowIn=Unity;

[Desktop Action Document]
Name=New File
Exec=/opt/Sublime_Text_2/sublime_text --command new_file
OnlyShowIn=Unity;

为了能够在命令行中使用 sublime text:

$ sudo ln -s /opt/Sublime_Text_2/sublime_text /usr/bin/subl

Sublime-text中文输入

主要参考 次要参考

首先要安装

$ sudo apt-get install libgtk2.0-dev

编译,放到/opt/Sublime_Text_2

修改/usr/share/applications/sublime-text-2.desktop(见document的备份文件)

设置

安装 package:

keymap and settings 见 my_linux_configuration

Markdown preview

sublime use a python26.zip in itself.Use pythonbrew can easily solve this problem:

$ curl -kL http://xrl.us/pythonbrewinstall | bash

add the following code in .zshrc or .bashrc:

[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc

install python2.6:

$ pythonbrew install --configure="--enable-unicode=ucs4 --with-zlib --with-ssl --with-threads --enable-share" 2.6

make a link of the pythonbrew 2.6 lib to the sublime python2.6 lib:

$ ln -s $HOME/.pythonbrew/pythons/Python-2.6/lib/python2.6 /Your_Sublime_Install_Path/lib/python2.6

in markdown preview settings:

{
...
"github_mode": "gfm",
"parser": "default"
}

support github flavored markdown

Other

https://realpython.com/blog/python/setting-up-sublime-text-3-for-full-stack-python-development/