gedit配置

geditGNOME 桌面的小型和轻量文本编辑器

因为之前看学长博客感觉燕大的电脑似乎比较[数据删除],于是去问了 CDsidi 大佬 vimgedit 咋用,然后我就从 vscodegedit 了。刚开始想用 vim,然后发现切换模式很麻烦还有离谱快捷键我直接放弃 vim。。。

所以就用了 gedit

刚开始用 gedit 不好用,因为他的 Home 键和 vscode 不大一样,是真的第一次按就调到最前面,而且没有自动补全,还有一些快捷键和 vscode 的不一致,但是时间长了就习惯了,打字速度也就回升了,而且真的挺好用的。

image

看右上角那三个横杠,点开它,找到首选项

image

点开

image

一个一个地说

  • 右边距线

显示右边距线这个我不知道有啥用,视觉效果上感觉就是右边加了个线和阴影,选不选都行,我觉得有点别扭所以没选

  • 网格图案

如果你喜欢浅色主题的话可以把显示网格图案给整上,有种网格本的感觉挺好看的

image

深色主题下。。。反正我这一版选上的话就长这样:

image

比较接地府(

  • 自动折行

我不喜欢gedit的自动折行,因为他折行的时候会加上一个 - (就跟英语单词没写完换行写的时候一样),虽然不是真的加上了,但是比较容易看错(

  • 高亮

高亮就不用说了

image

  • 制表符宽度

正常的那种就是宽度为 4,他默认是 8 改过来就行了

Code——“正常的那种”
inline char BFS(){
	memset(vis, 0, sizeof(vis));
	L = 0, R = -1; q[++ R] = (QUE){stx, sty}; vis[id(stx, sty)] = true;
	
	int x, y;
	while (L <= R){
		x = q[L].x, y = q[L].y; L ++;
		if (x == edx and y == edy)
			return true;
		if (x > 1 and s[x-1][y] == '.' and vis[id(x-1, y)] == false)
			q[++ R] = (QUE){x-1, y}, vis[id(x-1, y)] = true;
		if (x < n and s[x+1][y] == '.' and vis[id(x+1, y)] == false)
			q[++ R] = (QUE){x+1, y}, vis[id(x+1, y)] = true;
		if (y > 1 and s[x][y-1] == '.' and vis[id(x, y-1)] == false)
			q[++ R] = (QUE){x, y-1}, vis[id(x, y-1)] = true;
		if (y < m and s[x][y+1] == '.' and vis[id(x, y+1)] == false)
			q[++ R] = (QUE){x, y+1}, vis[id(x, y+1)] = true;
		if (target[id(x, y)].x != 0 and target[id(x, y)].y != 0 and vis[id(target[id(x, y)].x, target[id(x, y)].y)] == false and s[target[id(x, y)].x][target[id(x, y)].y] == '.')// 传送门
			q[++ R] = (QUE){target[id(x, y)].x, target[id(x, y)].y}, vis[id(target[id(x, y)].x, target[id(x, y)].y)] = true;
	}
	
	return false;
}

如果你喜欢那种很挤的风格那你可以设宽度为 2

Code——“那种很挤的风格”
inline char BFS(){
  memset(vis, 0, sizeof(vis));
  L = 0, R = -1; q[++ R] = (QUE){stx, sty}; vis[id(stx, sty)] = true;
  
  int x, y;
  while (L <= R){
    x = q[L].x, y = q[L].y; L ++;
    if (x == edx and y == edy)
      return true;
    if (x > 1 and s[x-1][y] == '.' and vis[id(x-1, y)] == false)
      q[++ R] = (QUE){x-1, y}, vis[id(x-1, y)] = true;
    if (x < n and s[x+1][y] == '.' and vis[id(x+1, y)] == false)
      q[++ R] = (QUE){x+1, y}, vis[id(x+1, y)] = true;
    if (y > 1 and s[x][y-1] == '.' and vis[id(x, y-1)] == false)
      q[++ R] = (QUE){x, y-1}, vis[id(x, y-1)] = true;
    if (y < m and s[x][y+1] == '.' and vis[id(x, y+1)] == false)
      q[++ R] = (QUE){x, y+1}, vis[id(x, y+1)] = true;
    if (target[id(x, y)].x != 0 and target[id(x, y)].y != 0 and vis[id(target[id(x, y)].x, target[id(x, y)].y)] == false and s[target[id(x, y)].x][target[id(x, y)].y] == '.')// 传送门
      q[++ R] = (QUE){target[id(x, y)].x, target[id(x, y)].y}, vis[id(target[id(x, y)].x, target[id(x, y)].y)] = true;
  }
  
  return false;
}

嗯差不多就是这意思了

  • 自动缩进

具体而言就是说你行末回车建立一个新行的时候,如果你不开的话那真的就是一个新行啥都没有,开了的话就是他已经给你塞好了一些 Tab 了,我的评价是开着比较舒服

  • 在保存前创建备份文件

不知道这是啥

  • 自动保存

其实吧,养成经常 Ctrl+S 的习惯就好了,因为他这个的自动保存比较生草,真的就是停止你现在的操作然后给你保存一下,就比如我用搜狗输入法打字的时候,如果他正好保存了,那我搜狗输入法界面(就那个打字的小框框)的字就给清空了((

当然如果你能忍得住这玩意过一会打断你一下的话那你可以开

image

  • 字体

机房电脑默认设置的这个字体我觉得就挺好的,机房默认字体是 Monospace Regular,我比较喜欢给他加粗一下换成 Monospace Bold,在哪里换的话就点image右边这个玩意,然后就能看到一群字体了,那个 Monospace Bold 就在 Monospace Regular 的下面:

image

大小的话我用的大小是 16,你喜欢用多大的你就用多大的

  • 配色方案

你愿意选哪个选哪个(

我用的是深色系的,还不是本来就有的,,我创建了一个 .xml 文件然后新添了一个配色方案,当然你研究研究自己配一个也行

整一个效果预览图

image

image

.xml 文件是从学长那里贺的,然后在这里找到了相同的配色方案,可能学长那个也是贺的?

但是有一个问题,就是这个主题他的注释颜色太深了,都快跟背景混在一块了,然后我把注释那一块改了一下,现在看着清楚多了,我把我改了之后的 .xml 给扔到这里

Code
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (C) 2011 Craig Russell
    Author: Craig Russell <craig@craig-russell.co.uk>
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
-->
<style-scheme id="char_phi" _name="char_phi" version="1.0">
    <author>tmz</author>
    <_description>qtmz</_description>

    <!-- Solarized Palette -->
    <color name="base03"  value="#000000"/>
    <color name="base02"  value="#041323"/>
    <color name="base01"  value="#233445"/>
    <color name="base00"  value="#456676"/>
    <color name="base0"   value="#839496"/>
    <color name="base1"   value="#A1A164"/>
    <color name="base2"   value="#EEE8D5"/>
    <color name="base3"   value="#FDF6E3"/>
    <color name="yellow"  value="#B58900"/>
    <color name="orange"  value="#CB4B16"/>
    <color name="red"     value="#DC322F"/>
    <color name="magenta" value="#D38662"/>
    <color name="violet"  value="#AC71C4"/>
    <color name="blue"    value="#268BD2"/>
    <color name="cyan"    value="#2AA198"/>
    <color name="green"   value="#A5AF00"/>

    <!-- Global Settings -->
    <style name="text"                        foreground="base1" background="base03"/>
    <style name="selection"                   foreground="base03" background="base00"/>
    <style name="cursor"                      foreground="base1"/>
    <style name="current-line"                background="base02"/>
    <style name="line-numbers"                foreground="base01" background="base02"/>

  
    <!-- Bracket Matching -->
    <style name="bracket-match"               foreground="base03" background="base01"/>
    <style name="bracket-mismatch"            foreground="red" background="base01"/>

    <!-- Search Matching -->
    <style name="search-match"                foreground="base03" background="yellow"/>  

    <!-- Comments -->
    <style name="def:comment"                 foreground="base0"/>
    <style name="def:shebang"                 foreground="base01" bold="true"/>
    <style name="def:doc-comment-element"     italic="true"/>

    <!-- Constants -->
    <style name="def:constant"                foreground="cyan"/>
    <style name="def:special-char"            foreground="green"/>

    <!-- Identifiers -->
    <style name="def:identifier"              foreground="blue"/>

    <!-- Statements -->
    <style name="def:statement"               foreground="orange"/>

    <!-- Types -->
    <style name="def:type"                    foreground="yellow"/>

    <!-- Operators -->
    <style name="def:operator"                foreground="green"/>
    <style name="def:bracket"                foreground="red"/>
    
    <!-- Others -->
    <style name="def:preprocessor"            foreground="violet"/>
    <style name="def:error"                   foreground="red" bold="true"/>
    <style name="def:note"                    foreground="magenta" bold="true"/>
    <style name="def:underlined"              italic="true" underline="true"/>

</style-scheme>

然后说一下怎么引入 .xml 文件作为配色方案:

首先你得先把这个 .xml 文件给建出来,复制上边的代码然后改一下后缀名随便给扔到哪个地方(记住扔到哪了)。文件名随便取,后缀是 .xml 就行

然后点这个界面的左下角那个 +

image

再找到你刚才把那个 .xml 文件给扔到哪了,选中它然后点右上角 添加方案

image

最后在配色方案那个界面选上添加的主题就行了

image

image

我这里是除了 python控制台 之外都选上了(因为我是学 C++ 的((

好了首选项说完了

image

就那个 『管理片段』,这玩意主要是辅助你写代码的

image

首先发现 Ctrl + / 不是注释了,而是全选,哭哭

然后就自己写一个 Alt + / 的(

分析他自带的那些得出了写法

首先左下角 + 号新建好吧

给你要建的这玩意随便取个名

然后就开写吧,如果你要设置特定快捷键启动的话,记得在右下那块设置快捷键

我这个写法只能是加注释,不能删注释,不知道有更高级的不(

// $0

别的你研究研究他的语法自己加也行

好像是要重新打开 gedit 才生效?没注意,自己试试吧

UPD: 好像不用重新打开,直接就生效(

但是你要改全局的快捷键那我不会改(比如把 Ctrl + Shift + Z 重做上一个命令给改成 Ctrl + Y,这玩意我不会)


然后还有一个功能就是他的 Tab 触发器,先看我改写的他这个 for循环

image

具体而言就是我写代码的时候写了一个 for,然后按一下 Tab 键就会蹦出来 for (re i = 1 ; i <= n; ++ i),然后那个 ${1:n} 是干啥用滴捏,就是说这玩意蹦出来之后我默认是选中那个 n 的,我可以直接改变循环终止位置,然后那个 $0 就是我改完之后再按一下 Tab 光标直接调到那个地方。

for (re i = 1 ; i <= ${1:n}; ++ i)$0

当然也有更高级的功能,比如:

for (re ${1:i} = 1 ; ${1:i} <= ${2:n} ; ++ ${1:i})$0

这样就是蹦出来 for (re i = 1 ; i <= n; ++ i) 后先选中了 i,如果你想把 i 改成 j 之类的这个 for 里面所有的 ${1:i} 括住的 i 都会变成 j,然后再按一下 Tab 就可以继续更改 n 了。全部改完之后再按一下 Tab 光标就会移到那个 $0 的位置。

侧边栏

众所周知 vscode 有个侧边栏供你快速打开文件,gedit 也有,按 F9 开启

image

他默认选的是文档也就是你当前都打开了啥,然后把文档改成文件浏览器就行了

image

image

别骂了别骂了那个Creaters文件夹不是拼写错误,我就是想取那个名(


然后如果你要学 gedit 的快捷键的话就在这里 ,都较为阳间

image


THE END

有啥要补充的欢迎留言qwq

posted @   char_phi  阅读(260)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示