centos下sublime2/3不能输入中文的问题
来源:互联网 发布:淘宝违法规则大全2016 编辑:程序博客网 时间:2024/05/20 21:42
sublime在centos下不能输入中文
- 首先下载”YaHei.Consolas.1.12.Revise.ttf”字体
- http://download.csdn.net/detail/naffan/4189649
- mkdir -p /usr/share/fonts/truetype/
- cd /usr/share/fonts/truetype
- mkfontscale
- mkfontdir
- fc-cache -fv
- 然后鼠标右键 change desktop background 的fonts的那一栏 所有的都选择成刚刚安装的字体
- 然后安装InputHelper,重启Sublime。之后”Ctrl+Shift+Z”,调出对话框,切换输入法,即可输入中文。
- 使用ctrl+` 跳出控制台,安装packageControl,输入
import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())
- 安装InputHelper
- 重启Sublime。之后”Ctrl+Shift+Z”,调出对话框,切换输入法,即可输入中文。输入后按enter打印在sublime上
基本设置
Preferences > Settings - User,添加Tab空格及显示:
“draw_white_space”: “all”,
“tab_size”: 4,
“translate_tabs_to_spaces”: true,
“font_face”: “YaHei Consolas Hybrid”,
出现的问题
Step 1: “Ctrl+`”调控制台,”Ctrl+Shift+Z”看输出:
FileNotFoundError: [Errno 2] No such file or directory: '/home/join/.config/sublime-text-3/Packages/InputHelper/lib/linux_text_input_gui.py'
https://github.com/xgenvn/InputHelper下载插件后安装到/home/xxx/.config/sublime-text-2/Packages/名称为InputHelper
Step 2: “Ctrl+Shift+Z”再看输出:
Traceback (most recent call last): File "/opt/sublime_text/sublime_plugin.py", line 549, in run_ return self.run(edit) File "/home/join/.config/sublime-text-3/Packages/InputHelper/inputhelper.py", line 21, in run proc = subprocess.Popen(args, stdout=subprocess.PIPE) File "X/subprocess.py", line 818, in __init__ File "X/subprocess.py", line 1416, in _execute_childPermissionError: [Errno 13] Permission denied
chmod 777 /home/xxx/.config/sublime-text-3/Packages/InputHelper/lib/linux_text_input_gui.py
Step 3: 然后”Ctrl+Shift+Z”果真弹出了对话框,但Sublime UI阻塞,未响应。
cd /home/xxx/.config/sublime-text-3/Packages/InputHelper/lib/
python2.6.6 linux_text_input_gui.py
输入内容后回车,看到如下错误:
AttributeError: ‘gtk.Entry’ object has no attribute ‘get_buffer’
Traceback (most recent call last):
File “linux_text_input_gui.py”, line 14, in destroy
self.print_text()
File “linux_text_input_gui.py”, line 9, in print_text
buffer = self.textInput.get_buffer()
AttributeError: ‘gtk.Entry’ object has no attribute ‘get_buffer’
如果centos安装的是python2.6.6安装pygtk模块的话,则用以下解决方式,查看linux_text_input_gui.py文件得知给”linux_text_input_gui.py”的”SimpleTextInput::print_text()”添加打印,看”self.textInput”的属性。直接有”get_text”,所以做如下修改:
def print_text(self):
# buffer = self.textInput.get_buffer()
# print(buffer.get_text())
print(self.textInput.get_text())
问题解决
Step 4:如果报没有pygtk模块的话,需要使用pip安装pygtk这个很麻烦,可参考另一篇博客。
- centos下sublime2/3不能输入中文的问题
- ubuntu下解决sublime2中文输入问题
- 解决sublime2在ubuntu上无法输入中文的问题
- 解决Ubuntu下QtCreator中不能输入中文的问题
- ubuntu14 下 sublime text2 不能输入中文的问题
- Ubuntu16.04下Intellij IDEA不能输入中文的问题
- Linux下解决qtcreator中不能输入中文的问题
- 解决Ubuntu下sublime text3不能输入中文的问题
- Sublime2 中文乱码问题
- Linux(centOS)下中文输入的问题
- ubuntu16下安装sublime-text-3,同时解决不能输入中文的问题。
- 解决ubuntu下sublime text 3 不能中文输入的问题
- vs2008不能输入中文的问题
- 解决JIRA不能输入中文的问题
- PowerPoint2007不能输入中文的问题
- 解决appium不能输入中文的问题
- emacs中文输入法不能输入的问题
- 解决ubuntu下android studio 不能输入中文问题
- leetcode 148. Sort List
- ulimit命令
- 项目管理概述
- 读书笔记之《暗店街》
- 频率分辨率
- centos下sublime2/3不能输入中文的问题
- 正则表达式必知必会(修订版)整理教程
- opencv不同版本官方安装包说明
- 计算机操作系统 核心理论基础-摘自西安电子科技大学第4版
- Adding an existing project to GitHub using the command line
- TSP问题之分支限界法
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
- java中的匿名内部类总结
- MXBridge - 插件式JS与OC交互框架