Ⅰ. 插件描述
Vim plugin to respect the Linux kernel coding style http://www.vim.org/scripts/script.php?script_id=4369Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'bhilburn/kernel-coding-style'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'bhilburn/kernel-coding-style'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'bhilburn/kernel-coding-style'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/bhilburn/kernel-coding-style
Ⅳ. 文档说明
Linux Kernel Formatting for ViM
This plugin simply provides the formatting settings necessary to adhere to the
Linux Kernel coding standards, available here: https://www.kernel.org/doc/Documentation/CodingStyle
Installation
Drop the plugin into your Pathogen bundle/ directory, or your personal scripts
- Simple!
Usage
To prevent these settings from overwriting your personal settings for C and C++
files, they will not be auto-applied to the files you open. You must invoke
the appropriate 'SetLinuxFormatting' command to apply them. Also, changes will
only take place in your local buffer - they are not global settings, and there
is no way to apply them to all buffers at once, for now.
An example of mapping applying the settings using the command key:
nnoremap <silent> <leader>k :SetLinuxFormatting<cr><cr>
Conclusion
Happy hacking =)