使用插件cvim时,\if意味着插入带有注释的函数。但格式是错误的

使用插件cvim时,\if意味着插入带有注释的函数。但格式是错误的,vim,Vim,嗯,正如标题所说。以下是我的C++源代码中现在看起来的样子: 1 2 /* 3 * === FUNCTION ============================================================= 4 * Name: sample_function 5 * Description: 6 * ===================

嗯,正如标题所说。以下是我的C++源代码中现在看起来的样子:

  1 
  2 /*                                  
  3 * ===  FUNCTION  =============================================================
  4 *         Name:  sample_function    
  5 *  Description:
  6     * =============================================================================
  7     */
  8     void sample_function ( <+argument_list+> )                                                                                                                       
  9     {
 10         return <+return_value+>;
 11     }       /* -----  end of function sample_function  ----- */
1
2 /*                                  
3*==函数=============================================================
4*名称:示例_函数
5*说明:
6     * =============================================================================
7     */
8无效样本函数()
9     {
10返回;
11}/*----函数结束示例\函数--*/
当我抬起头来 c-support/templates/cpp.idioms.template 或 c-support/templates/c.idioms.template 一切正常

似乎在插入模板代码时,vim会自己重新格式化它


有人能帮我吗?

自动缩进干扰了插入模板的方式。你应该向插件的作者报告这个问题

您可以通过关闭缩进来暂时解决问题;根据缩进设置,可以选择以下选项之一:

:set nocindent noautoindent nosmartindent indentexpr=

那么,上述解决方案只在vim会话中生效。而在vimrc中保存它将不起作用。是的,因为缩进方法可能是由
ftplugin/c.vim
设置的。你可能还想要自动缩进,不是吗?!正如我所说,这必须在插件本身中修复。