好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

Ubuntu安装Sublime Text 3--解决无法使用搜狗中文输入法

不用多说,Sublime Text是最受开发者欢迎的编辑器之一,清新的界面和强大的插件,你值得拥有哦~
下面小指简单介绍一下在Ubuntu下安装Sublime Text 3的过程:

首先到官网上下载Ubuntu的安装包:下载

然后用命令 sudo dpkg -ivh 安装包 安装

如果觉得麻烦,直接拷贝下面的命令安装最新3083版吧:

For Ubuntu 32位:

cd /tmp
wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3083_i386.deb
sudo dpkg -i sublime-text_build-3083_i386.deb

For Ubuntu 64位:

cd /tmp
wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3083_amd64.deb
sudo dpkg -i sublime-text_build-3083_amd64.deb

注意:实际安装路径会在 /opt/sublime_text/

安装完成后发现无法在Sublime输入中文,而小指使用的输入法是 搜狗For Linux输入法

解决办法:

保存下面的代码到文件 sublime_imfix.c ,命令: cd ~ && gedit sublime_imfix.c

代码:

#include <gtk/gtkimcontext.h>
void gtk_im_context_set_client_window (GtkIMContext *context,
         GdkWindow    *window)
{
 GtkIMContextClass *klass;
 g_return_if_fail (GTK_IS_IM_CONTEXT (context));
 klass = GTK_IM_CONTEXT_GET_CLASS (context);
 if (klass->set_client_window)
   klass->set_client_window (context, window);
 g_object_set_data(G_OBJECT(context),"window",window);
 if(!GDK_IS_WINDOW (window))
   return;
 int width = gdk_window_get_width(window);
 int height = gdk_window_get_height(window);
 if(width != 0 && height !=0)
   gtk_im_context_focus_in(context);
}

拷贝保存即可~


将上一步的代码编译成共享库 libsulime-imfix.so ,命令:

cd ~
gcc -shared -o libsublime-imfix.so sublime_imfix.c  `pkg-config --libs --cflags gtk+-2.0` -fPIC

有些童鞋无法编译,出现错误:


No package 'gtk+-2.0' found
sublime_imfix.c:1:30: fatal error: gtk/gtkimcontext.h: 没有那个文件或目录
 #include <gtk/gtkimcontext.h>

需要先安装必要的依赖:



sudo apt-get install libgtk2.0-dev

安装完成后重新编译,可以了吧~



然后将 libsublime-imfix.so 拷贝到 sublime_text 所在文件夹,命令:

cd ~
sudo mv libsublime-imfix.so /opt/sublime_text/


修改Sublime的命令 /usr/bin/subl 的内容:

sudo gedit /usr/bin/subl


将文件内容:

#!/bin/sh
exec /opt/sublime_text/sublime_text "$@"

替换修改为:

#!/bin/sh
LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text "$@"


完成后,在命令行中执行 subl 重启Sublime ,就可以使用搜狗For Linux的中文输入法了~


继续图形界面快捷方式 sublime_text.desktop 的修改:

sudo gedit /usr/share/applications/sublime_text.desktop


将[Desktop Entry]字段下的字符串:

Exec=/opt/sublime_text/sublime_text %F

替换修改为:

Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F"


将[Desktop Action Window]字段下的字符串:

Exec=/opt/sublime_text/sublime_text -n

替换修改为:

Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text -n"


将[Desktop Action Document]字段下的字符串:

Exec=/opt/sublime_text/sublime_text --command new_file

替换修改为:

Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text --command new_file"


注意:

修改时请注意双引号"",否则会导致不能打开带有空格文件名的文件。

完成替换后重启Sublime Text,就可以使用搜狗For Linux输入法输入中文了~

下一篇再教大家安装插件~

点赞5
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
bookoobeats
 bookoobeats 约 15 小时前回复
#136
<a href="http://www.sguerradesign.com/femminile-air-jordan-retro-11-verde-gituttio-scarpel">femminile air jordan retro 11 verde gituttio</a> <a href="http://www.zeneventsja.com/mens-asics-gel-noosa-tri-9-black-grey-shoesj">mens asics gel noosa tri 9 black grey</a> <a href="http://www.adharaweb.com/nike-hypershift-guld-bl%C3%A5-skok">nike hypershift guld bl氓</a> <a href="http://www.jrelselaw.com/mennns-nike-shox-turbo-13-laf-svart-maize-s%C3%B8lv-obuvp">mennns nike shox turbo 13 laf svart maize s酶lv</a> <a href="http://www.intellalegal.com/nike-blazer-mid-premium-red-shoesi">nike blazer mid premium red</a> <a href="http://www.carmelscoffee.com/herre-nike-air-max-thea-appelsin-hvid-skoj">herre nike air max thea appelsin hvid</a>
bookoobeats http://www.bookoobeats.com/
covergirlmag
 covergirlmag 2019-03-18 17:02回复
#135
<a href="http://www.doctid.com/nike-air-max-90-hyperfuse-r%C3%B8d-s%C3%B8lv-butye">nike air max 90 hyperfuse r酶d s酶lv</a> <a href="http://www.dhanakaryam.com/maschio-nike-air-max-2017-flyknit-blu-obuvd">maschio nike air max 2017 flyknit blu</a> <a href="http://www.djmattconsola.com/adidas-protator-zones-pro-manuel-neuer-handsome-obuvg">adidas protator zones pro manuel neuer handsome</a> <a href="http://www.chinchout.com/nike-mercurial-superfly-sg-bon-march%C3%A9-schuhef">nike mercurial superfly sg bon march茅</a> <a href="http://www.mccrarycabins.com/nike-air-max-87-lilla-oransje-obuve">nike air max 87 lilla oransje</a> <a href="http://www.javajoeshhi.com/adidas-john-wtutti-3-oro-argento-butye">adidas john wtutti 3 oro argento</a>
[url=http://www.covergirlmag.com/]covergirlmag[/url]
tarbiatesabz
 tarbiatesabz 2019-03-18 01:54回复
#134
<a href="http://www.techsrunch.com/nike-flyknit-trainer-cielo-azul-blanco-obuva">nike flyknit trainer cielo azul blanco</a> <a href="http://www.tlclease.com/hommes-ralph-lauren-shirt-kaki-gris-polox">hommes ralph lauren shirt kaki gris</a> <a href="http://www.beatsbybros.com/air-jordan-retro-10-marrone-verde-schuhee">air jordan retro 10 marrone verde</a> <a href="http://www.dankpixel.com/nike-free-l%C3%B8b-r%C3%B8d-bl%C3%A5-scarped">nike free l酶b r酶d bl氓</a> <a href="http://www.givenkface.com/nike-womens-rashaan-melvin-limited-whitepink-jersey-oakland-raiders-nfl-22-rush-fashion-nflw">nike womens rashaan melvin limited whitepink jersey oakland raiders nfl 22 rush fashion</a> <a href="http://www.kasabyd.com/stitched-mlb-chicago-cubs-walking-bear-sleeve-patch-nflz">stitched mlb chicago cubs walking bear sleeve patch</a>
tarbiatesabz http://www.tarbiatesabz.com/
ray ban cats sale
 ray ban cats sale 2019-03-17 21:38回复
#133
<a href="http://www.norigomme.com/where-to-k%C3%B8be-air-max-1-br%C3%B8d-kurpesc">where to k酶be air max 1 br酶d</a> <a href="http://www.bestcloisonne.com/nike-air-max-1-purple-australia-shoeso">nike air max 1 purple australia</a> <a href="http://www.distrodepot.com/nike-lunar-zapatos-for-corriendo-obuvb">nike lunar zapatos for corriendo</a> <a href="http://www.localeldernet.com/ray-ban-polarized-gradient-sunglasses-directions-sunglassese">ray ban polarized gradient sunglasses directions</a> <a href="http://www.birddogcams.com/browning-camo-hat-hats">browning camo hat</a> <a href="http://www.talgesq.com/gold-purple-mens-air-jordan-retro-5-shoes-sportsa">gold purple mens air jordan retro 5 shoes</a>
ray ban cats sale http://www.sicilierie.com/ray-ban-cats-sale-sunglassesr
talkwithgirl
 talkwithgirl 2019-03-16 06:45回复
#132
<a href="http://www.dowsadvocate.com/adidas-samba-bold-bl%C3%A5-skoi">adidas samba bold bl氓</a> <a href="http://www.laflammesinc.com/nike-hypervenom-blanc-chaussuresh">nike hypervenom blanc</a> <a href="http://www.thisisitnyc.com/notre-dame-beanie-hatl">notre dame beanie</a> <a href="http://www.tuurulz.com/nike-le-sableals-vert-chaussuresh">nike le sableals vert</a> <a href="http://www.todotecnicos.com/nike-air-max-90-mujeres-oro-negro-zapatosk">nike air max 90 mujeres oro negro</a> <a href="http://www.xaviersarrate.com/adidas-stan-smith-vintage-blue-shoesj">adidas stan smith vintage blue</a>
talkwithgirl http://www.talkwithgirl.com/
bkindvending
 bkindvending 2019-03-15 18:57回复
#131
<a href="http://www.diplomabroad.com/nike-mercurialx-proximo-ii-cr7-tf-cleats-schwarz-wei%C3%9F-fluorescent-gr%C3%BCn-schuhej">nike mercurialx proximo ii cr7 tf cleats schwarz wei脽 fluorescent gr眉n</a> <a href="http://www.trechadental.com/nike-magista-obra-ii-ag-gr%C3%BCn-schwarz-gelb-blau-schuhei">nike magista obra ii ag gr眉n schwarz gelb blau</a> <a href="http://www.akhbarsanaye.com/air-jordan-future-low-burgundy-camo-gr%C3%B8nn-obuvj">air jordan future low burgundy camo gr酶nn</a> <a href="http://www.timxes.com/porsche-design-bianca-scarpe-scarpel">porsche design bianca scarpe</a> <a href="http://www.leadercheetah.com/nike-roshe-run-rose-noir-chaussuresh">nike roshe run rose noir</a> <a href="http://www.arealleader.com/adidas-originals-eqt-support-adv-core-nero-scarpeh">adidas originals eqt support adv core nero</a>
bkindvending http://www.bkindvending.com/
yeliseeva
 yeliseeva 2019-03-15 08:19回复
#130
<a href="http://www.adanastarpen.com/kvinners-nike-air-force-1-low-royal-bl%C3%A5-obuvk">kvinners nike air force 1 low royal bl氓</a> <a href="http://www.actconfident.com/air-jordan-horizon-rosa-mint-gr%C3%B8nn-obuvi">air jordan horizon rosa mint gr酶nn</a> <a href="http://www.erzurumihl.com/mujeres-nike-air-max-90-blanco-amarillo-zapatosk">mujeres nike air max 90 blanco amarillo</a> <a href="http://www.candctowingil.com/coach-signature-handbags-clearance-coachh">coach signature handbags clearance</a> <a href="http://www.onlysidekick.com/nike-air-max-express-orange-grey-shoesj">nike air max express orange grey</a> <a href="http://www.rmmassage.com/nike-air-presto-sort-cem%C3%A6ndt-gr%C3%A5-skoq">nike air presto sort cem忙ndt gr氓</a>
yeliseeva http://www.yeliseeva.com/
tmzred
 tmzred 2019-03-15 05:45回复
#129
<a href="http://www.findatrans.com/maschio-asics-gel-kayano-21-rosa-gituttio-scarpel">maschio asics gel kayano 21 rosa gituttio</a> <a href="http://www.isabellerigal.com/adidas-nmd-runner-pink-red-shoesj">adidas nmd runner pink red</a> <a href="http://www.esnafkocaeli.com/air-jordan-horizon-gr%C3%B8n-hvid-skok">air jordan horizon gr酶n hvid</a> <a href="http://www.dkdjabar.com/mennns-asics-gel-noosa-tri-8-hvit-gr%C3%A5-obuvp">mennns asics gel noosa tri 8 hvit gr氓</a> <a href="http://www.jamiecirillo.com/nike-sb-dunk-low-qs-black-rain-shoesi">nike sb dunk low qs black rain</a> <a href="http://www.xpostshopx.com/adidas-rose-sort-bl%C3%A5-skoj">adidas rose sort bl氓</a>
tmzred http://www.tmzred.com/
tranhkhoathan
 tranhkhoathan 2019-03-15 02:17回复
#128
<a href="http://www.nonnagrazia.com/nike-huarache-high-rosso-argento-kurpesa">nike huarache high rosso argento</a> <a href="http://www.undecides.com/nike-kd-8-high-oro-marr%C3%B3n-kurpese">nike kd 8 high oro marr贸n</a> <a href="http://www.cardiffbmw.com/ralph-lauren-vest-vert-gris-poloz">ralph lauren vest vert gris</a> <a href="http://www.goldiumgroup.com/nike-roshe-run-sko-sort-carbon-sort-hvid-herre-scarpeb">nike roshe run sko sort carbon sort hvid herre</a> <a href="http://www.homeboyboom.com/green-bay-packers-scott-tolzien-official-nike-white-limited-women-s-road-nfl-jersey-nfls">green bay packers scott tolzien official nike white limited women s road nfl jersey</a> <a href="http://www.jolyjulie.com/air-jordan-retro-1-femmes-vert-violet-scarpeg">air jordan retro 1 femmes vert violet</a>
tranhkhoathan http://www.tranhkhoathan.com/
digisolnc
 digisolnc 2019-03-15 00:41回复
#127
<a href="http://www.lagunawoodsre.com/air-jordan-retro-3-kvinners-mint-gr%C3%B8nn-gr%C3%B8nn-obuvl">air jordan retro 3 kvinners mint gr酶nn gr酶nn</a> <a href="http://www.highbacklink.com/air-jordan-retro-17-green-pink-shoesh">air jordan retro 17 green pink</a> <a href="http://www.vuurogen.com/femminile-nike-air-max-95-gituttio-rosso-scarpei">femminile nike air max 95 gituttio rosso</a> <a href="http://www.rsvppersonnel.com/nike-roshe-run-gray-schwarz-schuhej">nike roshe run gray schwarz</a> <a href="http://www.shonema.com/houston-astros-new-era-mlb-blackout-mesh-9fifty-snapback-cap-hath">houston astros new era mlb blackout mesh 9fifty snapback cap</a> <a href="http://www.enventsurvey.com/air-jordan-melo-gris-bleu-chaussuresh">air jordan melo gris bleu</a>
digisolnc http://www.digisolnc.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸