个人工具

“Gedit”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
屏幕截图
 
(未显示5个用户的17个中间版本)
第1行: 第1行:
{{Translation}}
+
{{From|https://help.ubuntu.com/community/gedit}}
 
+
{{Translator|非线性失真 tianping}}
{{From|https://wiki.ubuntu.com/php5}}
+
{{Languages|UbuntuHelp:Gedit}}
 
+
{{Translator|非线性失真}}
+
 
+
{{Languages|php5}}
+
  
 
== 介绍 ==
 
== 介绍 ==
第12行: 第8行:
 
== 屏幕截图 ==
 
== 屏幕截图 ==
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=scrn-gedit.png
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=scrn-gedit.png
== Hints and Tips ==
+
== 小提示 ==
* To enable or disable automatic saving of backup files: Preferences > Editor > File Saving
+
* 打开或者关闭文件自动保存功能能,依次点击:编辑->首选项,在弹出的对话框中选择“编辑器”选项卡,选择“自动保存文件”,并且输入自动保存间隔。
* To make display text larger or smaller: Preferences > Fonts & Colors
+
* 调整文本字体以及字号的大小,依次点击:编辑->首选项,在弹出的对话框中选择“字体和颜色”选项卡,点击取消“使用系统等宽字体”前的勾,然后在下面调整字体以及字体大小
 
* For editing configuration files, for example your repository list (in Terminal):
 
* For editing configuration files, for example your repository list (in Terminal):
 +
如果您需要编辑一些配置文件,例如你的更新源列表(这项操作是在终端下进行的):
 
<pre><nowiki>
 
<pre><nowiki>
 
gksudo gedit /etc/apt/sources.list
 
gksudo gedit /etc/apt/sources.list
 
</nowiki></pre>
 
</nowiki></pre>
 
Note: If you need to run graphical applications as root, use gksudo, as shown above, as it will set up the environment more appropriately. Avoid ever using sudo with gui apps.
 
Note: If you need to run graphical applications as root, use gksudo, as shown above, as it will set up the environment more appropriately. Avoid ever using sudo with gui apps.
=== Using gedit for XML / Docbook XML ===
+
注意:如果您需要以root身份运行一些图形界面的程序,您可以向上面那样使用gksudo命令,gksudo命令可以适当的为您设置好图形运行环境。
One can use gedit for a more user-friendly way to make XML markup or Docbook XML for yelp documentation. The pictures and instructions given below uses gedit 2.18.1. You should make a few changes in gedit to take full benefit of the syntax color highlighting which gedit provides so simple mistakes are caught early. The process for this is as follows:
+
=== 使用gedit编辑 XML / Docbook XML ===
Under the View tab make the following changes:
+
你可以使用gedit为yelp文档制作XML标记或者Docbook XML标记。下面的截图和文字说明使用的gedit 版本是2.18.1。为了更好地利用gedit的语法加亮显示功能,你需要对gedit进行一下设定,这样就可以提前避免一些简单的错误。过程如下:
 +
在视图(View)选项页下做如下改动:
 +
 
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=gedit1.png
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=gedit1.png
The only one which could be an option is whether or not to see line numbers, but apart from that, most of the options just make life easier.
+
 
Now the next change to make is under Editor tab:
+
唯一需要改动的选项是要不要显示行号,除此之外,选中其他大部分选项都可以让软件更好用。
 +
下一项需要改动的内容在编辑(Edit)选项卡下:
 +
 
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=gedit2.png
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=gedit2.png
As one can see there is not much to do here. Now the next thing is to go to the Syntax Highlighting tab.
+
 
 +
你可以看到没有很多需要改的.下面再去语法加亮显示选项页。
 +
 
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditsyntaxhighlight.png
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditsyntaxhighlight.png
Now make sure that Syntax highlighting is turned on. Just to understand or for kicks go down the drop-down menu and see Docbook, on the left-hand side you see the various Elements and can see the various colors associated with that element. Later on you can change the preferences to your liking as you become more aware of what you would like to see or are more comfortable with.
+
 
Now jump to the Plugins Tab:
+
确保语法加亮这一项是选中的。点击下拉按钮打到DocBook,在左侧你可以看到许多Elements选项,右侧则是对Elements的设置,你可以自己修改。
 +
现在翻到插件选项页:
 +
 
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditplugins.png
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditplugins.png
There are a number of changes you can make here, the most important perhaps is the Tag List option. Feel free to make use of other options and see how that changes the text.
+
 
Now comes the most interesting part, go to View > Highlight Mode > Markup and while we want Docbook one can also see XML and both look slightly different from each other:
+
在这里你可以设定多项内容,其中最重要的是标记列表(Tag List)选项。你可以自己试一下其他选项的功能。
 +
现在到了最有趣的部分。打开 视图>高亮模式>标记,我们可以查看Docbook,也可以查看XML,还可以查看二者的细微区别:
 +
 
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditdocbook.png
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditdocbook.png
The above one is when the text is highlighted using geditdocbook. The same text when highlighted using XML looks like:
+
 
 +
上面显示出的是使用geditdocbook方式时的高亮模式。当使用XML高亮时它的效果如下:
 +
 
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditmarkup.png
 
https://help.ubuntu.com/community/gedit?action=AttachFile&do=get&target=geditmarkup.png
That's all, feel free to play around with gedit and markup in general to have a feel of what works and what doesn't.
+
 
#== Other applications you may wish to look at ==
+
先介绍这些。你可以自己尝试gedit的不同的标记模式,这样就会有一个直观的感觉。
 +
 
 +
== 外部链接 ==
 +
* [http://www.gnome.org/projects/gedit/ Gedit@gnome.org]
 +
 
 +
[[Category:GNOME]]
 +
[[Category:Ubuntu默认组件]]
 +
[[category:UbuntuHelp]]
 +
[[category:程序开发]]
 +
 
 +
== 中文问题 ==
 +
 
 +
由于ubuntu使用的是UFT-8编码,gedit在显示gb2312,gb18030一类windows下默认的中文编码文本文件时会出现乱码。
 +
 
 +
解决方法:
 +
  1.安装kate,一个可以选择编码的文本编辑器。可以很轻松的解问题。(推荐,功能比gedit强大)
 +
  2.使用openoffice打开。它会自动检测编码,成功率比较高。
 +
  3.alt+F2 运行gconf-editor,在apps->gedit-2->preferences->encodings在右边的auto-detected中双击会弹出一个对话框添加一个GB18030。注意把GB18030等中文的编码移动到最上面。但是,目前已经失效。可以在此基础上,删除ISO开头的西欧语言。(此方法随gedit版本不同效果不同)

2010年9月4日 (六) 16:20的最新版本


介绍

gedit 文本编辑器是ubuntu系统内初始的默认编辑器。它既适于基本的文本编辑,也适用于高级文本编辑。gedit在绝大多数ubuntu的发行版中都已经预装。

屏幕截图

gedit?action=AttachFile&do=get&target=scrn-gedit.png

小提示

  • 打开或者关闭文件自动保存功能能,依次点击:编辑->首选项,在弹出的对话框中选择“编辑器”选项卡,选择“自动保存文件”,并且输入自动保存间隔。
  • 调整文本字体以及字号的大小,依次点击:编辑->首选项,在弹出的对话框中选择“字体和颜色”选项卡,点击取消“使用系统等宽字体”前的勾,然后在下面调整字体以及字体大小
  • For editing configuration files, for example your repository list (in Terminal):

如果您需要编辑一些配置文件,例如你的更新源列表(这项操作是在终端下进行的):

gksudo gedit /etc/apt/sources.list

Note: If you need to run graphical applications as root, use gksudo, as shown above, as it will set up the environment more appropriately. Avoid ever using sudo with gui apps. 注意:如果您需要以root身份运行一些图形界面的程序,您可以向上面那样使用gksudo命令,gksudo命令可以适当的为您设置好图形运行环境。

使用gedit编辑 XML / Docbook XML

你可以使用gedit为yelp文档制作XML标记或者Docbook XML标记。下面的截图和文字说明使用的gedit 版本是2.18.1。为了更好地利用gedit的语法加亮显示功能,你需要对gedit进行一下设定,这样就可以提前避免一些简单的错误。过程如下: 在视图(View)选项页下做如下改动:

gedit?action=AttachFile&do=get&target=gedit1.png

唯一需要改动的选项是要不要显示行号,除此之外,选中其他大部分选项都可以让软件更好用。 下一项需要改动的内容在编辑(Edit)选项卡下:

gedit?action=AttachFile&do=get&target=gedit2.png

你可以看到没有很多需要改的.下面再去语法加亮显示选项页。

gedit?action=AttachFile&do=get&target=geditsyntaxhighlight.png

确保语法加亮这一项是选中的。点击下拉按钮打到DocBook,在左侧你可以看到许多Elements选项,右侧则是对Elements的设置,你可以自己修改。 现在翻到插件选项页:

gedit?action=AttachFile&do=get&target=geditplugins.png

在这里你可以设定多项内容,其中最重要的是标记列表(Tag List)选项。你可以自己试一下其他选项的功能。 现在到了最有趣的部分。打开 视图>高亮模式>标记,我们可以查看Docbook,也可以查看XML,还可以查看二者的细微区别:

gedit?action=AttachFile&do=get&target=geditdocbook.png

上面显示出的是使用geditdocbook方式时的高亮模式。当使用XML高亮时它的效果如下:

gedit?action=AttachFile&do=get&target=geditmarkup.png

先介绍这些。你可以自己尝试gedit的不同的标记模式,这样就会有一个直观的感觉。

外部链接

中文问题

由于ubuntu使用的是UFT-8编码,gedit在显示gb2312,gb18030一类windows下默认的中文编码文本文件时会出现乱码。

解决方法:

 1.安装kate,一个可以选择编码的文本编辑器。可以很轻松的解问题。(推荐,功能比gedit强大)
 2.使用openoffice打开。它会自动检测编码,成功率比较高。
 3.alt+F2 运行gconf-editor,在apps->gedit-2->preferences->encodings在右边的auto-detected中双击会弹出一个对话框添加一个GB18030。注意把GB18030等中文的编码移动到最上面。但是,目前已经失效。可以在此基础上,删除ISO开头的西欧语言。(此方法随gedit版本不同效果不同)