「GNU Emacs」- Treemacs(文件管理器) @20210601

问题描述

之前(01/31/2021),我们一直使用 Speedbar 与 Sr Speedbar 进行文件管理,但是问题太多。在配合 Tab Bar 使用时,也存在问题。因此,我们开始寻找其他可以替代 Speedbar 与 Sr Speedbar 的工具。

后来,找到并使用 Treemacs 来进行文件管理。如下为 Treemace 界面截图:

该笔记将记录:Treemacs 的使用方法及相关设置。

解决方案

项目仓库:Alexander-Miller/treemacs
安装方法:M-x package-install RET treemacs RET

常用设置记录

调整宽度

如果只是临时调整,可以取消锁定:
1)执行 M-x treemacs-toggle-fixed-width 命令,取消宽度锁定;
2)使用鼠标,手动调整宽度;
3)执行 M-x treemacs-toggle-fixed-width 命令,进行宽度锁定;

如果希望设置为自己满意的宽度,需要设置 treemacs-width 属性:
1)M-x customize-variable RET treemacs-width

调整每级目录的缩进长度

父目录与子目录,距离左侧的距离是不同的,因此我们才能区分出,哪个是父目录,哪个是子目录。

但是,默认的距离可能太长(或者太短),因此我们需要调整这个距离。有如下两种方法:
1)treemacs-indentation-string 指定用于缩进的字符串;treemacs-indentation 指定字符串重复次数

M-x customize-variable RET treemacs-indentation-string
M-x customize-variable RET treemacs-indentation
2)或者,使用 treemacs-indentation 指定缩进像素数
M-x customize-variable RET treemacs-indentation => Value Menu / Pixels

 

补充,我们使用缩进 10px 或者 1 x SPACE 设置。

参考文献

Alexander-Miller/treemacs


posted @ 2021-06-01 18:20  研究林纳斯写的  阅读(516)  评论(0编辑  收藏  举报