Ⅰ. 插件描述
some advanced vim html textobject mappingsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mjbrownie/html-advanced-text-objects'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mjbrownie/html-advanced-text-objects'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mjbrownie/html-advanced-text-objects'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mjbrownie/html-textobjects
Ⅳ. 文档说明
Repo: http://github.com/mjbrownie/html-textobjects
Example vid (includes other plugins): http://www.youtube.com/watch?v=NbV-OrFMalU
The inbuilt text object for html (cit cat) is great for the immediate tag but requires some additional movement if you have nesting.
This plugin gives you some more text objects to play with eg 'cahf' (cut-around-html-form) 'cihb' (cut-in-html-body) , 'viht' (visual-inner-html-table) , 'gUihd' (go UPPERCASE in html div)
This is still very much a work in progress any ideas on mapping naming conventions/ bugs etc please contact me.
" Dependencies:
"
" textobj-user by Kana Natsuno
" http://www.vim.org/scripts/script.php?script_id=2100
"
"
" Overview:
"
" This plugin adds some textobjects to the html filetype
"
" ihf/ahf - in/around a <form>
" ihf/ahd - in/around a <div>
" ihf/ahs - in/around a <span>
"
"
" ihb <body>
" ihp <p>
" ihu <ul>
" ihl <li>
" iht <table>
" ihr <tr>
" ihc <td> (in-html-cell to avoid clash with <div>)
""
" so Use as you would other text objects in visual selection, cutting and
" dealleting etc.
"
" Installation:
"
" Please ensure you have the above plugins installed as instructed
" This file should be in your after/ftplugin for html
"
" ~/.vim/after/ftplugin/html/html_textobjects.vim
"
" }}
Note theres a complimentary django textobject script