1
对于我的编码风格,我有一个很好的cindent配置,但是如果我将所有文件恢复到vim,我的文件的许可证头部会被重新格式化不正确。使用vim/cindent在C++文件中配置注释许可证头的缩进
许可证头:
/* =========================================================================
Program: Visualization Toolkit
Module: vtkPeriodicArray.txx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
========================================================================= */
我的.vimrc(相关部分):
:set tabstop=2 "Number of spaces a TAB in the text stands for
:set shiftwidth=2 "Number of spaces used for each step of (auto)indent
:set expandtab
:set cindent
:set cinoptions={1s,t0,f0s,g0,i0,(0
希望的结果:在许可证头缩进没有变化
看结果:
/* =========================================================================
Program: Visualization Toolkit
Module: vtkPeriodicArray.txx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
========================================================================= */