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

问题描述

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

后来,找到并使用 Treemacs 来进行文件管理。以下为 Treemace 界面截图:
watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=工具

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

解决方案

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

经常使用设置记录

调整宽度

若是只是临时调整,能够取消锁定:
1)执行 M-x treemacs-toggle-fixed-width 命令,取消宽度锁定;
2)使用鼠标,手动调整宽度;
3)执行 M-x treemacs-toggle-fixed-width 命令,进行宽度锁定;字符串

若是但愿设置为本身满意的宽度,须要设置 treemacs-width 属性:
1)M-x customize-variable RET treemacs-widthstring

调整每级目录的缩进长度

父目录与子目录,距离左侧的距离是不一样的,所以咱们才能区分出,哪一个是父目录,哪一个是子目录。emacs

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

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 设置。io

参考文献

Alexander-Miller/treemacsclass