根据全屏(:h fullscreen
)的帮助,有选项可以定制进入全屏模式时发生的行为fuoptions
在我的 MacVim 上,fuoptions 设置为
fuoptions=maxvert,maxhotz
当我们看:h fuoptions
maxvert When entering fullscreen, 'lines' is set to the maximum number
of lines fitting on the screen in fullscreen mode. When
leaving fullscreen, if 'lines' is still equal to the maximized
number of lines, it is restored to the value it had before
entering fullscreen.
maxhorz When entering fullscreen, 'columns' is set to the maximum number
of columns fitting on the screen in fullscreen mode. When
leaving fullscreen, if 'columns' is still equal to the maximized
number of columns, it is restored to the value it had before
entering fullscreen.
这意味着当你进入全屏模式时,MacVim 可以调整到最大行数和列数。(忽略您设置的值)
要解决此问题,您可以添加set fuoption-=maxhorz
以删除有问题的选项或添加set=maxvert
以强制它仅使用 maxvert ,而不管是否设置了其他选项。这会阻止 MacVim 在水平方向上覆盖您的设置。
所以你的固定命令看起来像
command! DistractionFreeMode set guioptions-=r gfn=Cousine:h12 showtabline=0 fuoptions-=maxhorz fullscreen laststatus=0 noruler wrap linebreak nolist linespace=5 foldcolumn=3 nonumber columns=80