Ⅰ. 插件描述
Vim Script library providing stylistic related functionsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'luchermitte/lh-style'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'luchermitte/lh-style'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'luchermitte/lh-style'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/luchermitte/lh-style
Ⅳ. 文档说明
Discl. This page is currently under heavy reorganization!
TODO:
- Complete the documentation
reorganize the sections to:
-[X] Intro -[ ] Features -[ ] Code formatting -[x] rationale -[ ] end-user side -[x] `.editorconfig` -[x] `.clang-format` (to be implemented) -[x] `:UseStyle` -[x] `:AddStyle` -[ ] extending the style families -[x] Naming policies -[ ] API -[ ] Contributing -[X] Installation
Introduction
lh-style is a vim script library that defines vim functions and commands that permit to specify stylistic preferences
like naming conventions, bracket formatting, etc.
In itself the only feature end-users can directly exploit is name converting based on the style name (snake_case,UpperCamelCase...) like Abolish plugin does, or on a given identifier kind (function, type, class, attribute...).
Check :NameConvert and ConvertNames -- sorry I wasn't inspired.
The main, and unique, feature is this plugin is to offer core functionalities, related to code-style, other plugins can
- Typical client plugins would be code generating plugins: wizards/snippet/abbreviation plugins, and refactoring
plugins.
The style can be tuned through options. The options are meant to be tuned by end-users, and indirectly used by plugin
- See API section to see how you could exploit these options from your plugins.
Snippets from lh-cpp and
mu-template, and refactorings from
lh-refactor exploit the options offered by lh-style for specifying code
style.
Note: The library has been extracted from lh-dev v2.x.x. in order to remove dependencies to lh-tags and other plugins from template/snippet expander plugins like mu-template. Yet, I've decided to reset the version counter to 1.0.0.
Features
lh-style permits to adjust the style of the code you generate along two axis:
- you can define a naming policy
- you can define a formatting style regarding the placement of brackets, spaces, newlines, and
so on.
Contributing
Contributions are welcomed. I've yet to write a proper CONTRIBUTING.md guide regarding copyright, licence and so on.
Installation
Requirements:
- Vim 7.+,
- lh-vim-lib (v4.0.0),
- editorconfig-vim (optional).
- Install with vim-addon-manager any plugin that requires lh-style should be enough.
- With vim-addon-manager, install lh-style (this is the preferred method because of the dependencies).
ActivateAddons lh-style
" will also install editorconfig-vim- vim-flavor (which also supports
dependencies)
flavor 'LucHermitte/lh-style'
" will also install editorconfig-vim- Vundle/NeoBundle:
Bundle 'LucHermitte/lh-vim-lib'
Bundle 'LucHermitte/lh-style'
" Optional
Bundle 'editorconfig/editorconfig-vim'- Clone from the git repositories
git clone git@github.com:LucHermitte/lh-vim-lib.git
git clone git@github.com:LucHermitte/lh-style.git
" Optional
git clone git@github.com:editorconfig/editorconfig-vim' 
