Ⅰ. 插件描述
Indent file per projectⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/coding-style-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/coding-style-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/coding-style-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/csindent.vim
Ⅳ. 文档说明
How to use the plug-in:
- Create
~/.vim_csindent.ini' (default value ofg:csindent_ini') with
format:
'[' <FILETYPE_NAME> [':' <DEFAULT_INDENT_NAME> ] ']'
<INDENT_NAME> '=' <PATH>
<INDENT_NAME> is common indent file without '.vim' suffix.
<PATH> is your path of project.
If exists <DEFAULT_INDENT_NAME>, then <DEFAULT_INDENT_NAME>.vim file is
default indent file for this filetype.
For example:
[cpp:shetukhin]
google = $HOME/work/pyctpp2
[c]
linux = $HOME/work/kernels/
gnu = $HOME/work/hurd
- Create `~/.vim/csindent/<FILETYPE_NAME>/<INDENT_NAME>.vim'
(instead of~/.vim/csindentyou can use any path from 'runtimepath').
For example:
~/.vim/csindent/cpp/shetukhin.vim
~/.vim/csindent/cpp/google.vim
~/.vim/csindent/c/linux.vim
~/.vim/csindent/c/gnu.vim
Note 1: This script is compatible with filetype indent.
See :help filetype.
Note 2: You can use more informative status line using CodingStyleIndent().
For example:
set statusline=%<%f%h%m%r%=style=%{CodingStyleIndent()}
%15(L%l,C%c%V%) %3P