特殊:Badtitle/NS100:Gedit:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:gedit}} | {{Languages|UbuntuHelp:gedit}} | ||
Parent: [[UbuntuHelp:Software]] | Parent: [[UbuntuHelp:Software]] | ||
== gedit Text Editor == | == gedit Text Editor == | ||
Gedit is the default text editor for Ubuntu. | Gedit is the default text editor for Ubuntu. | ||
Menu: Accessories > Text Editor | Menu: Accessories > Text Editor | ||
== Screenshot == | == Screenshot == | ||
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 == | == Hints and Tips == | ||
* To enable or disable automatic saving of backup files: Preferences > Editor > File Saving | * To enable or disable automatic saving of backup files: Preferences > Editor > File Saving | ||
* To make display text larger or smaller: Preferences > Fonts & Colors | * 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 === | === 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: | 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: | Under the View tab make the following changes: | ||
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. | 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: | Now the next change to make is under Editor tab: | ||
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. | 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 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: | Now jump to the Plugins Tab: | ||
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. | 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: | 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 | 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: | 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 | 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. Enjoy :) | 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. Enjoy :) | ||
== Other applications you may wish to look at == | == Other applications you may wish to look at == | ||
== Further Reading == | == Further Reading == | ||
* [http://www.gnome.org/projects/gedit/ gedit] | * [http://www.gnome.org/projects/gedit/ gedit] | ||
---- | ---- | ||
[[category:CategoryDocumentation]] | [[category:CategoryDocumentation]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年11月30日 (五) 17:26的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/gedit }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/af | • {{#if: UbuntuHelp:gedit|Afrikaans| [[::Gedit/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/ar | • {{#if: UbuntuHelp:gedit|العربية| [[::Gedit/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/az | • {{#if: UbuntuHelp:gedit|azərbaycanca| [[::Gedit/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/bcc | • {{#if: UbuntuHelp:gedit|جهلسری بلوچی| [[::Gedit/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/bg | • {{#if: UbuntuHelp:gedit|български| [[::Gedit/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/br | • {{#if: UbuntuHelp:gedit|brezhoneg| [[::Gedit/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/ca | • {{#if: UbuntuHelp:gedit|català| [[::Gedit/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/cs | • {{#if: UbuntuHelp:gedit|čeština| [[::Gedit/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/de | • {{#if: UbuntuHelp:gedit|Deutsch| [[::Gedit/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/el | • {{#if: UbuntuHelp:gedit|Ελληνικά| [[::Gedit/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/es | • {{#if: UbuntuHelp:gedit|español| [[::Gedit/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/fa | • {{#if: UbuntuHelp:gedit|فارسی| [[::Gedit/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/fi | • {{#if: UbuntuHelp:gedit|suomi| [[::Gedit/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/fr | • {{#if: UbuntuHelp:gedit|français| [[::Gedit/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/gu | • {{#if: UbuntuHelp:gedit|ગુજરાતી| [[::Gedit/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/he | • {{#if: UbuntuHelp:gedit|עברית| [[::Gedit/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/hu | • {{#if: UbuntuHelp:gedit|magyar| [[::Gedit/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/id | • {{#if: UbuntuHelp:gedit|Bahasa Indonesia| [[::Gedit/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/it | • {{#if: UbuntuHelp:gedit|italiano| [[::Gedit/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/ja | • {{#if: UbuntuHelp:gedit|日本語| [[::Gedit/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/ko | • {{#if: UbuntuHelp:gedit|한국어| [[::Gedit/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/ksh | • {{#if: UbuntuHelp:gedit|Ripoarisch| [[::Gedit/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/mr | • {{#if: UbuntuHelp:gedit|मराठी| [[::Gedit/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/ms | • {{#if: UbuntuHelp:gedit|Bahasa Melayu| [[::Gedit/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/nl | • {{#if: UbuntuHelp:gedit|Nederlands| [[::Gedit/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/no | • {{#if: UbuntuHelp:gedit|norsk| [[::Gedit/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/oc | • {{#if: UbuntuHelp:gedit|occitan| [[::Gedit/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/pl | • {{#if: UbuntuHelp:gedit|polski| [[::Gedit/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/pt | • {{#if: UbuntuHelp:gedit|português| [[::Gedit/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/ro | • {{#if: UbuntuHelp:gedit|română| [[::Gedit/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/ru | • {{#if: UbuntuHelp:gedit|русский| [[::Gedit/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/si | • {{#if: UbuntuHelp:gedit|සිංහල| [[::Gedit/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/sq | • {{#if: UbuntuHelp:gedit|shqip| [[::Gedit/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/sr | • {{#if: UbuntuHelp:gedit|српски / srpski| [[::Gedit/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/sv | • {{#if: UbuntuHelp:gedit|svenska| [[::Gedit/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/th | • {{#if: UbuntuHelp:gedit|ไทย| [[::Gedit/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/tr | • {{#if: UbuntuHelp:gedit|Türkçe| [[::Gedit/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/vi | • {{#if: UbuntuHelp:gedit|Tiếng Việt| [[::Gedit/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/yue | • {{#if: UbuntuHelp:gedit|粵語| [[::Gedit/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/zh | • {{#if: UbuntuHelp:gedit|中文| [[::Gedit/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/zh-hans | • {{#if: UbuntuHelp:gedit|中文(简体)| [[::Gedit/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:gedit | UbuntuHelp:gedit | {{#if: | :}}Gedit}}/zh-hant | • {{#if: UbuntuHelp:gedit|中文(繁體)| [[::Gedit/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:gedit|:Gedit|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Gedit/zh | | {{#ifexist: Gedit/zh | | {{#ifeq: {{#titleparts:Gedit|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Gedit|1|-1|}} | zh | | }}
Parent: UbuntuHelp:Software
gedit Text Editor
Gedit is the default text editor for Ubuntu. Menu: Accessories > Text Editor
Screenshot
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: 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: As one can see there is not much to do here. Now the next thing is to go to the Syntax Highlighting tab. 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: 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: The above one is when the text is highlighted using geditdocbook. The same text when highlighted using XML looks like: 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. Enjoy :)