如何让窗口大小固定?

发布于 2024-12-21 23:22:14 字数 111 浏览 6 评论 0原文

当我使用 nerdtree 浏览我的文件时,它总是碰巧使 NerdTree 调整大小以完全填充当前窗口,并且我不知道如何更改其默认宽度。有没有办法让nerdtree窗口的大小固定?或者将窗口大小重置为默认值?

When i am using nerdtree to browse my file, it always happened to make NerdTree to resize to full fill current window, and i don't know how to change to its default width. Is there a method to make the size of nerdtree window fixed? Or reset the window size to default?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

日暮斜阳 2024-12-28 23:22:14

很奇怪你有这个问题,但窗口宽度似乎是通过 g:NERDTreeWinSize 变量设置的,应该是 31 (你可以在插件源代码中看到这一点(参见第 44 行:https://github.com/scrooloose/nerdtree/blob/master/plugin/NERD_tree.vim

显然,在源脚本中设置这个变量是可行的,但应该有更好的方法在您的 .vimrc 中设置它,

您是否尝试过使用 A 来切换 nerdtree 窗口?

it is strange that you have this issue, but the widow width seems to be set via g:NERDTreeWinSize variable and should be 31 (you can see this in the plugin source (see line 44 here: https://github.com/scrooloose/nerdtree/blob/master/plugin/NERD_tree.vim)

obviously, setting this variable in the source script will work, but there should be better ways of setting it in your .vimrc.

have you tried toggling the nerdtree window using A? does that set the correct window size?

剩余の解释 2024-12-28 23:22:14

您可以通过将以下内容添加到 .vimrc 文件中来设置 NERDTree 窗口大小,例如设置为 26:

let NERDTreeWinSize=26

You can set the NERDTree window size, e.g. to 26, by adding the following to your .vimrc file:

let NERDTreeWinSize=26
追风人 2024-12-28 23:22:14

NERDTree 内部使用 winfixwidth。另一个有用的选项是 equalalways,如果关闭,则会禁用自动调整窗口大小创建或关闭窗口时。

Internally NERDTree uses winfixwidth. Another useful option is equalalways, if turned off, disables automatic window resizing when creating or closing windows.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文