Ⅰ. 插件描述
A vim text object for JSX attributes.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'inside/vim-textobj-jsxattr'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'inside/vim-textobj-jsxattr'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'inside/vim-textobj-jsxattr'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/inside/vim-textobj-jsxattr
Ⅳ. 文档说明
# vim-textobj-jsxattr
A vim text object for JSX attributes. Forked from
whatyouhide/vim-textobj-xmlattr
Usage
Use the text-objects ix and ax to operate on JSX attributes.
Examples
This is a JSX component, the pipe represents the cursor:
<TextField name='name' floatingLabelText='Nom' required fullWidth autoFocus
value={this.state.name} onChange={this.han|dleChange.bind(this, 'name')}
/>Hitting vax will visually select onChange={this.handleChange.bind(this, 'name')}.
Notice the space before. This is because you selected a attribute. Hittingvix will visually select the inner attributeonChange={this.handleChange.bind(this, 'name')} without the space.
Installation
" vim-plug
Plug 'kana/vim-textobj-user' | Plug 'inside/vim-textobj-jsxattr'
" NeoBundle
NeoBundle 'kana/vim-textobj-user'
NeoBundle 'inside/vim-textobj-jsxattr'
" Vundle
Plugin 'kana/vim-textobj-user'
Plugin 'inside/vim-textobj-jsxattr'