Gedit:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Dshbusiness留言 | 贡献
无编辑摘要
Dshbusiness留言 | 贡献
第12行: 第12行:
== 屏幕截图 ==
== 屏幕截图 ==
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):
<pre><nowiki>
gksudo gedit /etc/apt/sources.list
</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.
=== Using gedit for XML / Docbook XML ===
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:
Under the View tab make the following changes:
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:
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
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:
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:
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:
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 ==

2009年4月10日 (五) 17:12的版本

{{#ifexist: :Gedit/zh | | {{#ifexist: Gedit/zh | | {{#ifeq: {{#titleparts:Gedit|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Gedit|1|-1|}} | zh | | }}


介绍

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

屏幕截图

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):
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.

Using gedit for XML / Docbook XML

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: Under the View tab make the following changes: 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: 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. 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: 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: 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: 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.

  1. == Other applications you may wish to look at ==