mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
translated
This commit is contained in:
parent
f970228f1c
commit
06c8296216
@ -1,71 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Optimize your GNOME experience with the Gedit text editor)
|
||||
[#]: via: (https://opensource.com/article/20/12/gedit)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Optimize your GNOME experience with the Gedit text editor
|
||||
======
|
||||
It's a minimalistic editor that gets the job done, enhanced with great
|
||||
hidden features to make things easier.
|
||||
![Working from home at a laptop][1]
|
||||
|
||||
Being the default text editor is a thankless job. People usually regard a default text editor almost as a demo app—a slightly elevated "hello world" example of how an application on that platform is meant to run. Users resort to the default text editor in the rare occasions they need to dump some text into a file they’ll probably never look at again. For "serious" work, they turn to a word processor or an IDE, or an editor in the terminal, or at least a different text editor that has to be downloaded and installed like a "real" application.
|
||||
|
||||
It’s strangely difficult for a default text editor to be taken seriously, and yet the GNOME desktop’s editor, Gedit, is widely regarded as a truly valuable text editor beyond its parent desktop. It’s used as the required text editor in web design classes, a recommended tool for new developers and sysadmins, and a favorite reliable companion to many a desktop Linux user.
|
||||
|
||||
### Installing gedit
|
||||
|
||||
If you’re running the GNOME desktop, you probably already have gedit installed, although it may come up only as "Text Editor" in your application menu. If you’re not sure, just type **gedit** into your Activities screen, and then navigate to the **About** menu item in the text editor that opens.
|
||||
|
||||
![gedit terminal box with black background and white letters][2]
|
||||
|
||||
On Windows, you can download and [install gedit from the Microsoft Store][3].
|
||||
|
||||
On Mac, you can install gedit [using Homebrew][4] or [MacPorts][5].
|
||||
|
||||
### Using gedit
|
||||
|
||||
When you first launch gedit, you’ll get a minimalistic interface consisting of a text entry pane, a title bar, and a status panel at the bottom of the window. The bottom status panel provides quick access to a few common settings—what syntax highlighting schema you’d like to use, what tab width you prefer, and a few popular preferences such as line numbering, text wrapping, and so on. Most of these options can also be set globally in the Preferences menu, which is found in the "hamburger" menu in the top right corner of the application.
|
||||
|
||||
### Hidden features of gedit
|
||||
|
||||
On the surface, gedit is exactly what it advertises itself to be: a humble text editor that stays out of your way so you can type letters into a box on your screen. But this simple text editor is hiding several exciting features you may not know about, even if you’ve been using it for years.
|
||||
|
||||
These keyboard functions aren’t documented anywhere within gedit:
|
||||
|
||||
* **Ctrl+D** deletes the current line. This is especially useful for coders or those who write in a markdown format (such as Asciidoc, reST, or CommonMark).
|
||||
* **Ctrl+I** brings up the **Go to Line** drop-down field. Type in a number, and you’re taken immediately to that line number.
|
||||
* **Alt+Up-Arrow** or **Alt+Down-Arrow** grabs the current line and moves it up or down in your document.
|
||||
* **Alt-Left-Arrow** or **Alt+Right-Arrow** grabs the nearest word (to the left of the cursor) and moves it left or right.
|
||||
* To type a special Unicode character, press and release **Shift+Ctrl+U** and then type the Unicode character code. You usually have to look up the character code (unless you have some memorized, but who has available memory for character codes?) For instance, to render a penguin, press, and release **Shift+Ctrl+U**. After you’ve released the keys, you’re left with an underlined U, so type **1F427** followed by a space, and your Unicode entry is transformed into a friendly 🐧. Admittedly, this isn’t entirely unique to gedit, but it’s a useful trick to know, and it does work in gedit.
|
||||
|
||||
|
||||
|
||||
### Robust simplicity
|
||||
|
||||
Gedit is a lot like GNOME itself. It is objectively simpler than many of its peers (such as Kate from KDE), and yet it still manages to meet 80% or 90% of your daily expectations.
|
||||
|
||||
Of course, there probably will be a task for which gedit isn’t the best tool. You might find yourself delving deep into some unique log files or in need of a precise parser or linter, and you’ll move to a specialized application. That’s alright. Gedit isn’t meant to be everything to all users. But it is a great text editor for those in need of one, and sometimes that’s all that's required. Give gedit a try on Linux, or on whatever platform you’re using, because the chances are good that it’s a better choice than the default.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/gedit
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/gedit-31_days_gedit-opensource.jpg (gedit terminal box with black background and white letters)
|
||||
[3]: https://www.microsoft.com/en-nz/p/gedit
|
||||
[4]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[5]: https://opensource.com/article/20/11/macports
|
@ -0,0 +1,70 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Optimize your GNOME experience with the Gedit text editor)
|
||||
[#]: via: (https://opensource.com/article/20/12/gedit)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
使用 Gedit 文本编辑器优化你的 GNOME 体验
|
||||
======
|
||||
它是一个可以完成工作的简约编辑器,并以隐藏的增强功能使得事情更简单。
|
||||
![Working from home at a laptop][1]
|
||||
|
||||
作为默认的文本编辑器是一项吃力不讨好的工作。人们通常把默认文本编辑器几乎看作是一个演示应用,一个稍微好一点的 “hello World” 示例,说明应用在该平台上的是如何运行的。在极少数情况下,当用户需要将一些文本保存到一个可能永远不会再看的文件中时,用户会找到默认文本编辑器。对于“严肃”的工作,他们会转向文字处理器或 IDE,或终端中的编辑器,或者至少是一个不同的文本编辑器,必须像“真正的”应用一样下载和安装。
|
||||
|
||||
很奇怪,默认的文本编辑器很难被人重视,然而 GNOME 桌面的编辑器 Gedit 却被广泛认为是一个真正有价值的文本编辑器,超越了它所在的桌面。它被用作网页设计课程的必备文本编辑器,是新手开发者和系统管理员的推荐工具,也是许多桌面 Linux 用户最喜欢的可靠伙伴。
|
||||
|
||||
### 安装 gedit
|
||||
|
||||
如果你运行的是 GNOME 桌面,你可能已经安装了 gedit,尽管它可能只作为“文本编辑器”出现在你的应用菜单中。如果你不确定,只需在你的活动界面中输入 **gedit**,然后在打开的文本编辑器中进入**关于**菜单项。
|
||||
|
||||
![gedit terminal box with black background and white letters][2]
|
||||
|
||||
在 Windows 上,你可以[从微软商店下载并安装 gedit][3]。
|
||||
|
||||
在 Mac 上,你可以[使用 Homebrew][4]或 [MacPorts][5] 安装 gedit。
|
||||
|
||||
### 使用 gedit
|
||||
|
||||
当你第一次启动 gedit 时,你会看到一个简约的界面,包括一个文本输入面板、一个标题栏和一个位于窗口底部的状态面板。底部的状态面板提供了一些常用的设置:你想使用哪种语法高亮模式、你喜欢的标签宽度、以及一些流行的偏好,如行号、文本换行等等。这些选项中的大部分也可以在“首选项”菜单中进行全局设置,它可在应用程序右上角的“汉堡”样式的菜单中找到。
|
||||
|
||||
### gedit 的隐藏功能
|
||||
|
||||
从表面上看,gedit 正是它所标榜的那样:一个不起眼的文本编辑器,它不会妨碍你的工作,因此你可以在屏幕上的框中输入字母。但是,这个简单的文本编辑器却隐藏着一些你可能不知道的令人兴奋的功能,即使你已经使用它多年。
|
||||
|
||||
这些键盘功能在 gedit 中并没有被记录下来:
|
||||
|
||||
* **Ctrl+D** 删除当前行。这对于编码者或以 markdown 格式(如 Asciidoc、reST 或 CommonMark)写作的人特别有用。
|
||||
* **Ctrl+I** 会弹出 **Go to Line** 下拉框。输入一个数字,你就会立即跳到该行。
|
||||
* **Alt+向上箭头** 或 **Alt+向下箭头** 会抓取当前行,并将它在文档中向上或向下移动。
|
||||
* **Alt+向左箭头** 或 **Alt+向右箭头** 抓取最近的单词(在光标左侧)并将其向左或向右移动。
|
||||
* 要输入特殊的 Unicode 字符,请按下并松开 **Shift+Ctrl+U**,然后输入 Unicode 字符代码。你通常必须查找字符代码(除非你已经记住了一些,但谁有记性来记住这些字符代码?)例如,要打出一只企鹅,按下然后松开 **Shift+Ctrl+U**。当你松开按键后,你会看到一个带下划线的 U,然后输入 **1F427**,后面跟一个空格,你的 Unicode 字符就会变成一个友好的 🐧。诚然,这并不完全是 gedit 所独有的,但这是个很有用的技巧,而且它在 gedit 中也确实有效。
|
||||
|
||||
|
||||
|
||||
### 稳定简单
|
||||
|
||||
Gedit 很像 GNOME 本身。它客观上比许多同类软件(比如 KDE 的 Kate)更简单,但它仍然能够满足你日常 80% 或 90% 的期望。
|
||||
|
||||
当然,可能会有一些任务 gedit 不是最佳工具。你可能会发现自己要深入研究一些独特的日志文件,或者需要一个精确的解析器或代码检查器,你会转向专门的应用。这没关系。Gedit 并不意味着对所有用户都适用。但对于那些需要文本编辑器的人来说,它是一个很好的文本编辑器,有时这就是所需要的。在 Linux 或者在任何你正在使用的平台上,试一下 gedit,因为它很有可能是一个比默认的更好的选择。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/gedit
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/gedit-31_days_gedit-opensource.jpg (gedit terminal box with black background and white letters)
|
||||
[3]: https://www.microsoft.com/en-nz/p/gedit
|
||||
[4]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[5]: https://opensource.com/article/20/11/macports
|
Loading…
Reference in New Issue
Block a user