无法将 Vim 的折叠方法从标记更改为手动 [英] Unable to change foldingmethod for Vim from marker to manual

查看:34
本文介绍了无法将 Vim 的折叠方法从标记更改为手动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然,我的Vim开始指定fdm=marker而不管下面两个规范

All of a sudden, my Vim starts with specifying fdm=marker regardless of the following two specifications

  • _vimrc中,都在beignning adn底部,set fdm=manual;
  • 根据文件类型,通过 ~/vim/vimfiles/ftplugin 中的 *.vim 文件指定了 set fdm=manual.
  • In _vimrc, both in the beignning adn bottom, set fdm=manual;
  • Per file type, have specified set fdm=manual through the *.vim files found in ~/vim/vimfiles/ftplugin.

大约一周前,当我更新 _vimrc 时,相同的设置一直运行良好.但是,我今天才注意到,标记"是无缘无故指定的.

Same setting had been working well around a week ago, when I updated the _vimrc. However, I just notice today that "marker" had been speificed for no reason.

有什么建议吗?我已经尝试 Grep~vimfiles 目录中所有标记"的存在.这变成了一项不合理的工作,因为有成千上万的 marker.

Any suggestion? I have tried to Grep all the presences of "marker" in the ~vimfiles directory. This turned to be an unreasonable job to do, as there are thousands of presences of marker.

我还尝试在我的 _vimrc 中指定以下内容,但根本不起作用.<代码>autocmd BufEnter * 无声!设置 fdm=manual无论我打开什么类型的文件,fdm=manual 都会在命令行中输入 set fdm 后弹出.(按:).

I have also tried to specify the following in my _vimrc, which did not work at all. autocmd BufEnter * silent! set fdm=manual fdm=manual will always pop up regardless of what type of file I open, upon typing set fdm in the command line. (by pressing :).

我刚刚在 Github 上发布了我的 Vim:https://github.com/llinfeng/Vim

I have just made my Vim available on Github under: https://github.com/llinfeng/Vim

一切顺利,

-临丰

推荐答案

这只是部分答案:

一个名为restore_view.vim"的插件导致了这个问题.卸载它后,我尝试过的两种设置都成功了.

A plug-in called "restore_view.vim" is causing the problem. Upon uninstalling it, both settings I've tried did the work.

我的猜测是,虽然 _vimrc~/ftplugin/ 中的*.vim"文件确实得到了源代码,但restore_view"插件将恢复旧的查看",其中包括折叠方法和格式选项,在采购过程的最后.因此,之前所有的fdmformatoptions 设置都已恢复,无法应用新实现的设置.

My guess is that, while _vimrc and "*.vim" files in ~/ftplugin/ did get sourced, the "restore_view" plugin will restore the "old view", which includes the folding methods and formatoptions, at the very end of the sourcing process. Therefore, all the previous settings of fdm and formatoptions had been restored and the newly implemented ones cannot be applied.

这里是这个插件的github镜像:https://github.com/vim-scripts/restore_view.vim/blob/master/plugin/restore_view.vim

Here goes the github mirror of this plugin: https://github.com/vim-scripts/restore_view.vim/blob/master/plugin/restore_view.vim

作为我帖子的解决方案,只需删除插件即可解决所有问题.但是,如何正确部署restore_view"插件仍然是一个悬而未决的问题.我已通过电子邮件向作者提出建议,并将在 Stack Overflow 上提出一个新问题.

As a solution to my post, simply removing the plugin will solve all the issues. However, it remains to be an open question of how to properly deploy the "restore_view" plugin. I have emailed the author for suggestion and will also start a new question on Stack Overflow.

这篇关于无法将 Vim 的折叠方法从标记更改为手动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆