歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu中Atom編輯器顯示中文亂碼的處理方法

Ubuntu中Atom編輯器顯示中文亂碼的處理方法

日期:2017/2/28 13:57:30   编辑:Linux教程

在Ubuntu14.04 64位機上安裝Atom,依次在終端輸入如下命令:

1.$ sudo add-apt-repository ppa:webupd8team/atom

2.$ sudo apt-get update

3. $ sudo apt-get install atom

處理中文亂碼的問題:

1.安裝文泉驿正黑等相關中文字體:$ sudo apt-get install -y ttf-wqy-zenhei fonts-wqy-zenhei ttf-wqy-microhei

2.查看系統中文字體:$ fc-list :lang=zh

3.打開Atom:

(1)、Edit -> Open Your Config,刪除原有內容,輸入如下內容,保存:

"*":
"exception-reporting":
userId: "fe150ae1-7895-9104-88e4-51ddc09f54d7"
welcome:
showOnStartup: false
core: {}
editor:
invisibles: {}
fontFamily: "Ubuntu Mono, DejaVu Sans Mono, 文泉驿等寬正黑"
fontSize: 15

(2)、Edit ->Open Your Stylesheet,刪除原有內容,輸入如下內容,保存:

@mono-font-family: "Ubuntu Mono", "文泉驿等寬正黑"; /* 等寬字體 */
@font-family: "Ubuntu", "文泉驿正黑"; /* 非等寬字體 */
html, body, ol, ul, li, h1, h2, h3, h4, h5, h6, div, p, span, pre, section, input, textarea,
table, .atom-panel, .status-bar, .tree-view, .title, .current-path, .tooltip {
font-family: @font-family;
}

.autocomplete-plus span, code, .-tree-view-, .symbols-view /*,.editor*/ {
font-family: @mono-font-family;
}

atom-text-editor.editor {
font-family: @mono-font-family;
}

.-tree-view- {
font-size: 14px;
}

4.關閉Atom,再次打開即可。

Ubuntu 下通過 PPA 安裝 Atom http://www.linuxidc.com/Linux/2014-05/101501.htm

非官方構建的 Windows 下的 Atom 編輯器 http://www.linuxidc.com/Linux/2014-05/101505.htm

在Ubuntu下編譯安裝Atom編輯器 http://www.linuxidc.com/Linux/2014-05/101417.htm

Ubuntu 及衍生系統安裝 Atom 0.104.0 http://www.linuxidc.com/Linux/2014-06/103518.htm

Ubuntu/Linux Mint上安裝Atom文本編輯器 http://www.linuxidc.com/Linux/2014-08/105624.htm

Github Atom 的詳細介紹:請點這裡
Github Atom 的下載地址:請點這裡

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved