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.
========================================================================= */