From d13d48417a3df712b02d7972049888adeed39b00 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Apr 2023 16:42:12 +0800 Subject: [PATCH] ATRP @wxy https://linux.cn/article-15688-1.html --- ... 10 Tweaks to Supercharge Gedit as Code Editor.md | 242 ++++++++++++++++++ ... 10 Tweaks to Supercharge Gedit as Code Editor.md | 239 ----------------- 2 files changed, 242 insertions(+), 239 deletions(-) create mode 100644 published/20230401.3 â­ï¸â­ï¸ 10 Tweaks to Supercharge Gedit as Code Editor.md delete mode 100644 sources/tech/20230401.3 â­ï¸â­ï¸ 10 Tweaks to Supercharge Gedit as Code Editor.md diff --git a/published/20230401.3 â­ï¸â­ï¸ 10 Tweaks to Supercharge Gedit as Code Editor.md b/published/20230401.3 â­ï¸â­ï¸ 10 Tweaks to Supercharge Gedit as Code Editor.md new file mode 100644 index 0000000000..60a082f288 --- /dev/null +++ b/published/20230401.3 â­ï¸â­ï¸ 10 Tweaks to Supercharge Gedit as Code Editor.md @@ -0,0 +1,242 @@ +[#]: subject: "10 Tweaks to Supercharge Gedit as Code Editor" +[#]: via: "https://itsfoss.com/gedit-tweaks/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15688-1.html" + +å°† Gedit 作为代ç ç¼–辑器的 10 项增强调整 +====== + +![][0] + +> Gedit 是一个好的文本编辑器。用这些技巧ã€çªé—¨å’Œè°ƒæ•´æŠŠå®ƒå˜æˆä¸€ä¸ªå¥½çš„代ç ç¼–辑器。 + +GNOME å¯èƒ½å·²ç»æŠ›å¼ƒäº† Gedit 作为默认的文本编辑器,但它ä»ç„¶æ˜¯ Linux è€ç”¨æˆ·çš„最爱。 + +它主è¦æ˜¯ä¸€ä¸ªæ–‡æœ¬ç¼–辑器,但通过一些调整,它å¯ä»¥ä½œä¸ºä¸€ä¸ªè½»é‡çº§çš„代ç ç¼–辑器使用。 + +是啊ï¼ä¸ºä»€ä¹ˆè¦ç”¨ VS Code 或其他专门的代ç ç¼–辑器æ¥ç¼–写 Bash 脚本或其他语言的简å•ç¨‹åºï¼Ÿç”¨ Gedit 也å¯ä»¥è¿‡ä¸€å¤©ã€‚ + +我将在本文中分享一些我最喜欢的 Gedit 技巧和çªé—¨ã€‚虽然大多数的调整对写代ç æ˜¯æœ‰ç›Šçš„,但有些对一般的文本写作也是有帮助的。 + +### 1ã€å®‰è£…æ’件 + +å¯èƒ½ä¸ªåˆ«äººç”šè‡³ä¸çŸ¥é“ Gedit 有强大的æ’件功能。你å¯ä»¥å®‰è£…æ’件æ¥èŽ·å¾—é¢å¤–的功能。 + +有两ç§ç±»åž‹çš„æ’件: + +- å¯ä»¥ä»Žç¼–辑器èœå•ä¸­è®¿é—®çš„官方 Gedit æ’件 +- 第三方æ’件,å¯ä»¥ä»Žé¡¹ç›®ç½‘站上下载,并放入æ’件目录中(下é¢è®¨è®ºï¼‰ã€‚ + +Gedit æ’件å¯ä»¥æ”¾åœ¨ `/usr/share/gedit/plugins` 或 `~/.local/share/gedit/plugins` 目录下。 + +![][2] + +ä½ å¯ä»¥é€šè¿‡ç‚¹å‡» “汉堡包†èœå•ï¼Œç„¶åŽæ‰“å¼€ “首选项Preferences†窗å£æ¥è®¿é—®å¯ç”¨å’Œå·²å®‰è£…çš„æ’件。 + +![][3] + +首选项窗å£æœ‰ “æ’件Plugins†标签,你å¯ä»¥çœ‹åˆ°æ‰€æœ‰å¯ç”¨çš„æ’件。你å¯ä»¥ä½¿ç”¨å¤é€‰æ¡†æ¥å¯ç”¨å’Œç¦ç”¨è¿™äº›æ’件。 + +![][4] + +### 2ã€åœ¨ä¾§è¾¹æ ä¸­æ˜¾ç¤ºæ–‡ä»¶æµè§ˆå™¨ + +如果你正在处ç†ä¸€ä¸ªæœ‰å¤šä¸ªæ–‡ä»¶å’Œæ–‡ä»¶å¤¹çš„项目,在侧边æ ä¸­ç”¨æ–‡ä»¶æµè§ˆå™¨çœ‹åˆ°æ‰€æœ‰å¯ç”¨çš„文件是相当有用的。 + +进入 “首选项†-> “æ’件â€ï¼Œå¯ç”¨ “文件æµè§ˆå™¨é¢æ¿File Browser Panelâ€ã€‚ + +![][5] + +之åŽï¼Œç‚¹å‡»å³ä¸Šè§’的汉堡包èœå•ï¼Œä»Žèœå• “查看View†-> “侧é¢æ¿Side Panel†å¯ç”¨ä¾§é¢æ¿è§†å›¾ã€‚ + +现在把侧é¢æ¿è§†å›¾æ”¹ä¸ºæ–‡ä»¶æµè§ˆå™¨ï¼Œå¦‚果还没有的è¯ã€‚ + +![][6] + +### 3ã€åµŒå…¥ä¸€ä¸ªç»ˆç«¯ + +是的ï¼ä½ å¯ä»¥åœ¨ Gedit 文本编辑器中直接嵌入一个终端。 + +这有什么æ„义呢?嗯,如果你正在写程åºæˆ–脚本,嵌入终端å¯ä»¥å¸®åŠ©ä½ è¿è¡Œè„šæœ¬ï¼Œå¹¶åœ¨ç¼–辑器中检查代ç çš„å˜åŒ–。 + +![][7] + +è¦å¾—到这个,首先è¦å®‰è£…这个æ’件(针对 Ubuntu): + +``` +sudo apt install gedit-plugin-terminal +``` + +一旦æ’件安装完毕,从 “首选项†-> “æ’件†中å¯ç”¨å®ƒã€‚ + +![][8] + +嗯,从汉堡包èœå•-> “查看â€-> “底部é¢æ¿Bottom Panel†中å¯ç”¨åº•éƒ¨é¢æ¿ã€‚ + +![][9] + +### 4ã€Markdown 预览 + +喜欢 Markdown å—ï¼Ÿæˆ‘ä¹Ÿæ˜¯ï¼ + +有几个适用于 Linux çš„ Markdown 编辑器,但你ä¸å¿…为了使用 Markdown 而去安装å¦ä¸€ä¸ªåº”用程åºã€‚ + +在一个å为 “[Gedit Markdown Preview][10]†的æ’件的帮助下,Gedit 完全有能力呈现 Markdown 代ç ã€‚ + +Arch 用户å¯ä»¥åœ¨ AUR 中找到它,软件包为 `gedit-plugin-markdown_preview`。 + +其他 Linux 用户å¯ä»¥æ‰¾åˆ° [项目网页上的安装说明][11]。 + +一旦安装,在æ’件中å¯ç”¨å®ƒã€‚你必须从汉堡包èœå• -> “查看â€-> “侧é¢æ¿â€ 中å¯ç”¨ä¾§é¢æ¿è§†å›¾ã€‚ + +![][12] + +有了这个,它就开始在侧é¢æ¿æˆ–底部窗格中显示 Markdown 文本的渲染文本。 + +![][13] + +### 5ã€åˆ›å»ºä»£ç ç‰‡æ®µ + +*好的ç å†œç¼–ç ï¼Œä¼˜ç§€ç å†œå¤ç”¨ã€‚* + +如果你å‘现自己é‡å¤ä½¿ç”¨åŒä¸€æ®µä»£ç æˆ–文本,你å¯ä»¥å°†å…¶ä¿å­˜ä¸ºç‰‡æ®µï¼Œå¹¶åœ¨éœ€è¦æ—¶æ’入。这将为你节çœä¸€äº›æ—¶é—´ï¼ˆå’ŒæŒ«æŠ˜ï¼‰ã€‚ + +å…ˆå¯ç”¨ç‰‡æ®µæ’件: + +![][14] + +现在你å¯ä»¥ä»Žæ±‰å ¡åŒ…èœå•-> “管ç†ç‰‡æ®µManage Snippets†æ¥è®¿é—®ç‰‡æ®µã€‚ + +![][15] + +你会å‘现它已ç»æœ‰å‡ ä¸ªä¸ºå„ç§ç¼–程语言添加的片段。 + +![][16] + +你也å¯ä»¥é€šè¿‡ç‚¹å‡»å·¦ä¸‹è§’çš„ “+†å·å°†ä½ çš„片段添加到所需的文件夹中。你也å¯ä»¥ä¸ºç‰‡æ®µæŒ‡å®šä¸€ä¸ªå¿«æ·é”®ï¼Œä»¥ä¾¿æ›´å¿«é€Ÿåœ°æ’入它们。 + +![][17] + +例如,我为 [添加一个 Markdown 表格][18] 添加了一个新的片段,并为其分é…了一个键盘快æ·é”®å’Œ TAB 触å‘器(如上图所示)。现在,如果我在 Markdown 文档中按 `CTRL + Alt + S`,就会添加一个表格。或者,输入 `table` 并按下 `TAB` 键也会添加 Markdown 表格。 + +> 💡 通常,片段被ä¿å­˜åœ¨ `/usr/share/gedit/plugins/snippet` 文件夹中作为 XML 文档,但我找ä¸åˆ°æ–°æ·»åŠ çš„片段被ä¿å­˜åœ¨å“ªé‡Œã€‚ + +### 6ã€ä¿®å¤æ·±è‰²æ¨¡å¼çš„问题 + +ç¼–ç å‘˜å–œæ¬¢æ·±è‰²æ¨¡å¼ã€‚Gedit éµå®ˆç³»ç»Ÿä¸»é¢˜ï¼Œå¦‚果你在æ“作系统层é¢åˆ‡æ¢åˆ°æ·±è‰²æ¨¡å¼ï¼Œå®ƒä¹Ÿä¼šåˆ‡æ¢åˆ°æ·±è‰²æ¨¡å¼ã€‚ + +一个主è¦çš„问题是,你无法阅读当å‰é€‰å®šè¡Œçš„任何内容,因为文本和行的高亮部分都是白色的。 + +![][19] + +这个问题没有解决办法。然而,一个å˜é€šçš„办法是,è¦ä¹ˆç¦ç”¨å½“å‰è¡Œçš„高亮显示,è¦ä¹ˆä½¿ç”¨ä¸åŒçš„颜色方案。 + +进入 “首选项†-> “字体和颜色Font & Colorsâ€ï¼Œç„¶åŽé€‰æ‹©åƒ Oblivion 这样的深色方案。这将ç¨å¾®æ”¹å˜é¢œè‰²æ–¹æ¡ˆï¼Œä½†è‡³å°‘你能看到高亮行的文字。 + +![][20] + +### 7ã€å¿«é€Ÿé«˜äº®é€‰ä¸­çš„文本 + +åŒå‡»ä¸€ä¸ªè¯ï¼ŒGedit 就会高亮显示整个文档中出现的所有相åŒçš„è¯ã€‚ + +![][21] + +虽然有一个官方æ’件,但这个功能默认是ä¸å¯ç”¨çš„。 + +进入 “首选项†-> “æ’件â€ï¼Œå¯ç”¨ “快速高亮Quick Highlight†选项。 + +![][22] + +### 8ã€æ˜¾ç¤ºè¡Œå· + +许多代ç ç¼–辑器默认都会显示行å·ã€‚当你看到 “第 X 行的语法错误 †时,它å¯ä»¥å¸®åŠ©ä½ å¿«é€Ÿæ‰¾åˆ°è¯¥è¡Œã€‚ + +ä½ å¯ä»¥é€šè¿‡è¿›å…¥ “首选项†-> “查看†-> “显示行å·æ¥å¯ç”¨è¡Œå·Display Line Numbersâ€ï¼š + +![][23] + +你也å¯ä»¥ä»Žåº•éƒ¨å¯ç”¨æˆ–åœç”¨å®ƒã€‚ + +![][24] + +### 9ã€ä¿å­˜ä¸€ä¸ªç‰ˆæœ¬ + +如果你正在修改一个文件,也许建立一个备份副本会更好?Gedit å¯ä»¥è‡ªåŠ¨åšåˆ°è¿™ä¸€ç‚¹ã€‚ + +在 “首选项†-> “编辑器Editor†-> “创建一个备份副本Create a Backup copy†中å¯ç”¨è¿™ä¸ªåŠŸèƒ½ã€‚ + +![][25] + +一个在原文件å称åŽé¢åŠ ä¸Š `~` 符å·çš„文件将作为备份文件出现。 + +![][26] + +### 10ã€è‡ªåŠ¨ä¿å­˜æ–‡ä»¶ + +既然我们在谈论版本和备份,那么 [在 Gedit 中å¯ç”¨è‡ªåŠ¨ä¿å­˜][27] 怎么样?这样,如果你在处ç†ä¸€ä¸ªæ–‡ä»¶æ—¶ï¼Œå¿˜è®°ç”¨ `Ctrl+S` 手动ä¿å­˜ï¼Œä¿®æ”¹çš„内容会自动ä¿å­˜ã€‚ + +> 🚧 这个功能对一个从未在ç£ç›˜ä¸Šä¿å­˜è¿‡çš„全新文档ä¸èµ·ä½œç”¨ã€‚ + +从 “å好†-> “编辑器â€ï¼Œä½ å¯ä»¥å¯ç”¨ “自动ä¿å­˜Autosaveâ€ åŠŸèƒ½ã€‚é»˜è®¤æƒ…å†µä¸‹ï¼Œå®ƒæ¯ 10 分钟自动ä¿å­˜ä¸€æ¬¡ï¼Œä½†ä½ å¯ä»¥æ ¹æ®è‡ªå·±çš„喜好改å˜æ—¶é—´ã€‚ + +![][28] + +还有一个第三方的 [smart-auto-save 扩展][29],å¯ä»¥åœ¨ä½ åœæ­¢è¾“入时自动ä¿å­˜æ–‡æ¡£ã€‚ + +![][30] + +### 知é“更多的 Gedit 技巧å—? + +使用任何软件的ä¹è¶£ä¹‹ä¸€æ˜¯å‘现它ä¸é‚£ä¹ˆæ˜Žæ˜¾çš„功能。 + +在这里,你最喜欢哪个 Gedit 的调整?你知é“一个没有多少人知é“çš„ Gedit 的秘ç±å—?在评论中与我们分享å§ï¼Ÿ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gedit-tweaks/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) è£èª‰æŽ¨å‡º + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp +[2]: https://itsfoss.com/content/images/2023/03/PLUGIN-INSTALL-gedit-plugin-saved-to-the-directory.png +[3]: https://itsfoss.com/content/images/2023/03/ACCESS-PREFERENCES.png +[4]: https://itsfoss.com/content/images/2023/03/PLUGIN-INSTALL-plugins-in-prefereneces.png +[5]: https://itsfoss.com/content/images/2023/03/FILE-BROWSER-file-browser-plugin-in-preferences.png +[6]: https://itsfoss.com/content/images/2023/03/FILE-BROWSER-file-browser-as-a-side-pane.png +[7]: https://itsfoss.com/content/images/2023/03/TERMINAL-gedit-embedded-terminal.png +[8]: https://itsfoss.com/content/images/2023/03/TERMINAL-embedded-terminal-plugin-in-plugins-tab.png +[9]: https://itsfoss.com/content/images/2023/03/TERMINAL-enable-bottom-panel-for-embedded-terminal.png +[10]: https://github.com/maoschanz/gedit-plugin-markdown_preview?ref=itsfoss.com +[11]: https://github.com/maoschanz/gedit-plugin-markdown_preview?ref=itsfoss.com#installation +[12]: https://itsfoss.com/content/images/2023/03/ENABLE-SIDE-PANEL.png +[13]: https://itsfoss.com/content/images/2023/03/MARKDOWN-PREVIEW-markdown-preview.png +[14]: https://itsfoss.com/content/images/2023/03/ENABLE-SNIPPET-PLUGLIN.png +[15]: https://itsfoss.com/content/images/2023/03/ACCESS-MANAGE-SNIPPET.png +[16]: https://itsfoss.com/content/images/2023/03/SNIPPET-pre-created-snippets-in-gedit-showing-cpp-main-snippet.png +[17]: https://itsfoss.com/content/images/2023/03/adding-a-custom-markdown-table-snippet.png +[18]: https://itsfoss.com/markdown-table/ +[19]: https://itsfoss.com/content/images/2023/03/DARK-MODE-ISSUE-text-not-visible-in-highlight-line.png +[20]: https://itsfoss.com/content/images/2023/03/DARK-MODE-ISSUE-settting-a-new-clor-scheme-to-the-dark-mode-font-issue.png +[21]: https://itsfoss.com/content/images/2023/03/QUICK-HIGHLIGHT-result.png +[22]: https://itsfoss.com/content/images/2023/03/QUICK-HIGHLIGHT-already-available-plugin-no-external-needed.png +[23]: https://itsfoss.com/content/images/2023/03/LINE-NUMBER-display-line-numbers-in-gedit.png +[24]: https://itsfoss.com/content/images/2023/03/SHOW-LINE-NUMBERS.png +[25]: https://itsfoss.com/content/images/2023/03/SAVE-BACKUP.png +[26]: https://itsfoss.com/content/images/2023/03/VERSION-in-file-manager.png +[27]: https://itsfoss.com/how-to-enable-auto-save-feature-in-gedit/ +[28]: https://itsfoss.com/content/images/2023/03/AUTO-SAVE-files-the-built-in-save-function-that-saves-the-document-after-some-time.png +[29]: https://github.com/seanh/gedit-smart-autosave/?ref=itsfoss.com +[30]: https://itsfoss.com/content/images/2023/03/AUTO-SAVE-Smart-auto-save.png +[31]: https://itsfoss.com/flatpak-tips-tweaks/ +[0]: https://img.linux.net.cn/data/attachment/album/202304/03/163721ts31zsxhs1wuwp63.jpg \ No newline at end of file diff --git a/sources/tech/20230401.3 â­ï¸â­ï¸ 10 Tweaks to Supercharge Gedit as Code Editor.md b/sources/tech/20230401.3 â­ï¸â­ï¸ 10 Tweaks to Supercharge Gedit as Code Editor.md deleted file mode 100644 index fa7fac9c06..0000000000 --- a/sources/tech/20230401.3 â­ï¸â­ï¸ 10 Tweaks to Supercharge Gedit as Code Editor.md +++ /dev/null @@ -1,239 +0,0 @@ -[#]: subject: "10 Tweaks to Supercharge Gedit as Code Editor" -[#]: via: "https://itsfoss.com/gedit-tweaks/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -10 Tweaks to Supercharge Gedit as Code Editor -====== - -![][1] - -GNOME may have ditched Gedit as the default text editor but it is still a favorite of long-time Linux users. - -It is primarily a text editor, but with some tweaks, it can work as a lightweight code editor. - -Yeah! Why use VS Code or other dedicated code editors for writing Bash scripts or simple programs in other languages? Gedit saves the day. - -I'll share some of my favorite Gedit tips and tricks in this article. While most of the tweaks are beneficial for writing codes, some could be helpful for general text writing as well. - -### 1. Install plugins - -Few people don't even know that Gedit has a robust plugin feature. You can install plugins to get additional features. - -There are two kinds of plugins: - -- Official Gedit plugins that are accessible from the editor menu -- Third-party plugins that can be downloaded from the project websites and placed into the plugins directory (discussed below) - -The Gedit plugins can be located in `/usr/share/gedit/plugins` or  `~/.local/share/gedit/plugins` directories. - -![][2] - -You can access the available and installed plugins by clicking the Hamburger menu and then opening the Preference window, - -![][3] - -The Preferences window has the Plugins tab and you can see all the plugins available to you. You can use the checkbox to enable and disable the plugins. - -![][4] - -### 2. Show file browser in the side panel - -If you are working on a project that has multiple files and folders, getting the file browser to see all the available files in the sidebar is quite helpful. - -Go to **Preferences -> Plugins** and enable the **File Browser Panel**. - -![][5] - -After that, click on the hamburger menu at top right and enable the Side Panel View from Menu **View -> Side Panel** - -Now change the side panel view to file browser, if not already. - -![][6] - -### 3. Embed a terminal - -Yes! You can embed a terminal right into the Gedit text editor. - -What's the point? Well, if you are writing programs or scripts, an embed terminal helps you run the script and check the code changes right there in the editor. - -![][7] - -To get this, first install the plugin (for Ubuntu): - -``` -sudo apt install gedit-plugin-terminal -``` - -Once the plugin is installed, enable it from Preferences->Plugin. - -![][8] - -Mow, enable bottom panel from hamburger menu -> **View -> Bottom Panel** - -![][9] - -### 4. Markdown preview - -Love Markdown? Me too! - -There are several Markdown editors available for Linux but you don't have to install another application just to use Markdown. - -With the help of a plugin, unsurprisingly called [Gedit Markdown Preview][10], Gedit is perfectly capable of rendering Markdown code. - -Arch users can find it in the AUR as gedit-plugin-markdown_preview package. - -Other Linux users can find the [installation instructions on the project webpage][11]. - -Once it is installed, enable it in plugins. You must enable the side panel view from the hamburger menu --> View > Side panel - -![][12] - -With that, it starts showing rendered text for Markdown text in the side or bottom pane. - -![][13] - -### 5. Create snippets - -_Good coders code. Better coders reuse._ - -If you find yourself reusing same piece of code or text, you can save it as snippet and insert it when needed. This will save you some time (and frustration). - -Enable the Snippet plugin first. - -![][14] - -Now you can access the snippets from **Hamburger Menu -> Manage Snippets** - -![][15] - -You'll find that it already has several snippets added for various programming languages. - -![][16] - -You can also add your snippets in the desired folder by clicking the + sign on the bottom left. You may also assign a shortcut key to snippets to insert them even more quickly. - -![][17] - -For example, I added a new snippet for [adding a Markdown table][18] and assigned a keyboard shortcut and tab trigger to it (as seen in the above image). Now, if I press **CTRL + Alt + S** in a Markdown document, a table is added. Alternatively, typing **table** and pressing the TAB key also adds the Markdown table. - -> 💡 Usually, the snippets are saved in `/usr/share/gedit/plugins/snippet` folder as XM docs, but I could not find where the newly added snippets are saved. - -### 6. Fix the dark mode problem - -Coders love dark mode. Gedit adheres to the system theme, and if you switch to dark mode at the OS level, it also switches to dark mode. - -The one major problem is that you cannot read anything on the currently selected line because both text and line highlights are white colored. - -![][19] - -There is no fix for this. However, a workaround is to either disable highlighting the current line or use a different color scheme.I prefer choosing a different color scheme. - -Go to Preferences -> Font & Colors and then select a dark color scheme like Oblivion. It will change the color scheme a little but at least you will be able to see the text on the highlighted lines. - -![][20] - -### 7. Quick highlight selected text - -Double-click a word and Gedit highlights all the occurrences of the same word in the entire document. - -![][21] - -This feature is not enabled by default though an official plugin is available. - -Go to Preferences -> Plugins and enable the Quick Highlight option. - -![][22] - -### 8. Show line numbers - -Many code editors show the line numbers by default. It helps you quickly go to the line when you see a 'syntax error at line X'. - -You can enable line numbers by going to **Preferences -> View -> Display Line Numbers:** - -![][23] - -You may also enable or disable it from the bottom. - -![][24] - -### 9. Save a version - -If you are modifying a file, perhaps it would be better to create a backup copy? Gedit can do this automatically. - -Enable this feature in **preferences -> Editor -> Create a Backup copy**. - -![][25] - -A file with the name of the original file appended with a `~` symbol will appear as the backup file. - -![][26] - -### 10. Autosave files - -Since we are talking about versions and backups, how about [enabling autosave in Gedit][27]? This way, if you are working on a document and forgot to save it using Ctrl+S manually, the changes get saved automatically. - -> 🚧 This feature does NOT work on a completely new document that has never been saved on the disk. - -From **Preferences -> Editor**, you can enable the Autosave feature. By default, it autosaves every 10 minutes but you can change the duration to your liking. - -![][28] - -There is also a third-party [smart-auto-save extension][29] that autosaves the document as soon as you stop typing it. - -![][30] - -### Know more Gedit tricks? - -One of the joys of using any piece of software is discovering it's not-so-obvious features. - -Which Gedit tweaks you liked the most here? Do you know a killer Gedit feature that not many people are aware of? Share it with us in the comments? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/gedit-tweaks/ - -作者:[Abhishek Prakash][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) è£èª‰æŽ¨å‡º - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lkxed/ -[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp -[2]: https://itsfoss.com/content/images/2023/03/PLUGIN-INSTALL-gedit-plugin-saved-to-the-directory.png -[3]: https://itsfoss.com/content/images/2023/03/ACCESS-PREFERENCES.png -[4]: https://itsfoss.com/content/images/2023/03/PLUGIN-INSTALL-plugins-in-prefereneces.png -[5]: https://itsfoss.com/content/images/2023/03/FILE-BROWSER-file-browser-plugin-in-preferences.png -[6]: https://itsfoss.com/content/images/2023/03/FILE-BROWSER-file-browser-as-a-side-pane.png -[7]: https://itsfoss.com/content/images/2023/03/TERMINAL-gedit-embedded-terminal.png -[8]: https://itsfoss.com/content/images/2023/03/TERMINAL-embedded-terminal-plugin-in-plugins-tab.png -[9]: https://itsfoss.com/content/images/2023/03/TERMINAL-enable-bottom-panel-for-embedded-terminal.png -[10]: https://github.com/maoschanz/gedit-plugin-markdown_preview?ref=itsfoss.com -[11]: https://github.com/maoschanz/gedit-plugin-markdown_preview?ref=itsfoss.com#installation -[12]: https://itsfoss.com/content/images/2023/03/ENABLE-SIDE-PANEL.png -[13]: https://itsfoss.com/content/images/2023/03/MARKDOWN-PREVIEW-markdown-preview.png -[14]: https://itsfoss.com/content/images/2023/03/ENABLE-SNIPPET-PLUGLIN.png -[15]: https://itsfoss.com/content/images/2023/03/ACCESS-MANAGE-SNIPPET.png -[16]: https://itsfoss.com/content/images/2023/03/SNIPPET-pre-created-snippets-in-gedit-showing-cpp-main-snippet.png -[17]: https://itsfoss.com/content/images/2023/03/adding-a-custom-markdown-table-snippet.png -[18]: https://itsfoss.com/markdown-table/ -[19]: https://itsfoss.com/content/images/2023/03/DARK-MODE-ISSUE-text-not-visible-in-highlight-line.png -[20]: https://itsfoss.com/content/images/2023/03/DARK-MODE-ISSUE-settting-a-new-clor-scheme-to-the-dark-mode-font-issue.png -[21]: https://itsfoss.com/content/images/2023/03/QUICK-HIGHLIGHT-result.png -[22]: https://itsfoss.com/content/images/2023/03/QUICK-HIGHLIGHT-already-available-plugin-no-external-needed.png -[23]: https://itsfoss.com/content/images/2023/03/LINE-NUMBER-display-line-numbers-in-gedit.png -[24]: https://itsfoss.com/content/images/2023/03/SHOW-LINE-NUMBERS.png -[25]: https://itsfoss.com/content/images/2023/03/SAVE-BACKUP.png -[26]: https://itsfoss.com/content/images/2023/03/VERSION-in-file-manager.png -[27]: https://itsfoss.com/how-to-enable-auto-save-feature-in-gedit/ -[28]: https://itsfoss.com/content/images/2023/03/AUTO-SAVE-files-the-built-in-save-function-that-saves-the-document-after-some-time.png -[29]: https://github.com/seanh/gedit-smart-autosave/?ref=itsfoss.com -[30]: https://itsfoss.com/content/images/2023/03/AUTO-SAVE-Smart-auto-save.png -[31]: https://itsfoss.com/flatpak-tips-tweaks/