Ⅰ. 插件描述
Teach Vim about titlecase, with support for motions and text objectsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'christoomey/vim-titlecase'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'christoomey/vim-titlecase'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'christoomey/vim-titlecase'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/christoomey/vim-titlecase
Ⅳ. 文档说明
Vim Titlecase
Titlecase is a vim plugin that adds a new operator (command that takes a text
object or motion to act on) for titlecasing text.
this is some text | this is Some text
method('some args') | method('Some Args')
a title line | A Title Line
Usage
The main interface to the plugin is via the <Plug>Titlecase operator, by
default mapped to gt.
The gt mapping will wait for a text object or motion before completing the
titlecase operation. This means gti' will titlecase inside of single quotes,gtap will titlecase a paragraph, etc. gt will also work on a visual
selection.
In addition, gT will titlecase the current line.
Mappings
Be default titlecase maps itself to gt, but this interferes with the default
mapping for switching tabs. If you would like to disable the default maps, add
the following to your vimrc:
Bundle 'christoomey/vim-titlecase'
let g:titlecase_map_keys = 0You can then add any mappings you would like with the following:
nmap <leader>gt <Plug>Titlecase
vmap <leader>gt <Plug>Titlecase
nmap <leader>gT <Plug>TitlecaseLine<Plug>Titlecase " Titlecase the region defined by a text object or motion
<Plug>TitlecaseLine " Titlecase the entire line