Ⅰ. 插件描述
Makes it easy to switch whole files between snake case, hyphenation and camel case.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'chiedo/vim-case-convert-is-written-on'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'chiedo/vim-case-convert-is-written-on'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'chiedo/vim-case-convert-is-written-on'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/chiedo/vim-case-convert
Ⅳ. 文档说明
Vim-case-convert - Update the case of your variables.
Makes switching between camel case, snake case and hyphenated variables quick. Great for conforming legacy code bases or code written by a developer who ignored the standards to the desired case.
Installation
Pathogen Install
- Navigate to your [VIM_ROOT]/bundle directory in your local Vim setup
- git clone https://github.com/chiedojohn/vim-case-convert.git
Usage
To convert the case, select a block of text in visual mode and the enter one of the following (Self explanatory) :
:CamelToHyphen
:CamelToSnake
:HyphenToCamel
:HyphenToSnake
:SnakeToCamel
:SnakeToHyphenThese commands switch the case in ALL lines spanned by the visual selection, also outside it. To limit conversion to visual selection contents use the following:
:CamelToHyphenSel
:CamelToSnakeSel
:HyphenToCamelSel
:HyphenToSnakeSel
:SnakeToCamelSel
:SnakeToHyphenSelTo convert all occurences in your document then run one of the following commands:
:CamelToHyphenAll
:CamelToSnakeAll
:HyphenToCamelAll
:HyphenToSnakeAll
:SnakeToCamelAll
:SnakeToHyphenAdd a bang (eg. :CamelToHyphen!) to any of the above command to bypass the prompts before each conversion.
You may not want to do that though as the plugin wouldn't know the different between variables or other text in your file.
License
Distributed under the same terms as Vim itself. See :help license.
Credits
http://vim.wikia.com/wiki/Converting_variables_to_or_from_camel_case