vim-textobj-xmlattr


Ⅰ. 插件描述

A vim text object for XML/HTML attributes.

Ⅱ. 基本信息

创建日期:  2014-06-01
使用用户:  45
Github星:  55
插件作者:  Andrea Leopardi

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'whatyouhide/vim-textobj-xmlattr'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'whatyouhide/vim-textobj-xmlattr'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'whatyouhide/vim-textobj-xmlattr'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/whatyouhide/vim-textobj-xmlattr

Ⅳ. 文档说明

# vim-textobj-xmlattr

Build Status

This vim plugin provides two text objects: ax and ix.
They represent XML/HTML attributes.

It's based on (and requires)
vim-textobj-user.

These attributes will work:

<div class="box" id=footer data-updatable data-content="everything"></div>

ix works with the inner attribute, with no surrounding whitespace. ax works
like aw does: it includes the whitespace before the attribute. I know
that aw includes the whitespace after/before or whatever it finds more
fitty, but XML/HTML attributes always include whitespace before them, while they
do not always include whitespace after:

<some-tag with-only="one attribute"/>

When I dix, I want to be left with a valid XML/HTML tag, that's why I didn't
consider leading and trailing whitespaces.

Installation

I'm a recent vim-plug convert, and I'm super happy with this plugin

  1. Check out its page, you will be amazed too (Vundle will look way less
    appealing!).
" vim-plug
Plug 'kana/vim-textobj-user' | Plug 'whatyouhide/vim-textobj-xmlattr'
" NeoBundle
NeoBundle 'kana/vim-textobj-user'
NeoBundle 'whatyouhide/vim-textobj-xmlattr'
" Vundle
Plugin 'kana/vim-textobj-user'
Plugin 'whatyouhide/vim-textobj-xmlattr'

Out-of-touch people that still use Pathogen can just clone the repository:

git clone https://github.com/whatyouhide/vim-textobj-xmlattr ~/.vim/bundle

Contributing

Fork the repository, commit your changes, and send a Pull Request. I'm more than
happy to get help!

License

© Andrea Leopardi

添加新评论