Code Monkey home page Code Monkey logo

vim-textobj-css's Introduction

vim-textobj-css

Text objects in Vim are very useful. They allow you to modify text by word, sentence, paragraph, HTML tag, and more. vim-textobj-user is a Vim plugin that lets you define your own text objects and this project builds on that one to let you work with CSS blocks more easily.

demo

Usage

  • vic Visually select inner CSS (inner rules)
  • vac Viscually select "all" CSS (entire block w/ selector(s))
  • cic Change inner CSS
  • cac Change "all" CSS
  • dic Delete inner CSS
  • dac Delete "all" CSS

It's often handy to visually select a nested CSS block with vac and then type ac again to expand the selection to the parent block. This is shown in the above GIF.

⚠️ Warning if you use vim-gitgutter ⚠️

vim-gitgutter supplies some text objects for dealing with hunks and these conflict with vim-textobj-css. As the vim-gitgutter README describes, you can override those settings with something like:

omap ih <Plug>GitGutterTextObjectInnerPending
omap ah <Plug>GitGutterTextObjectOuterPending
xmap ih <Plug>GitGutterTextObjectInnerVisual
xmap ah <Plug>GitGutterTextObjectOuterVisual

Installation

This plugin requires vim-textobj-user. Use your favorite plugin manager to add these lines.

vim-plug

Plug 'kana/vim-textobj-user'
Plug 'jasonlong/vim-textobj-css'

NeoBundle

NeoBundle 'kana/vim-textobj-user'
NeoBundle 'jasonlong/vim-textobj-css'

Vundle

Plugin 'kana/vim-textobj-user'
Plugin 'jasonlong/vim-textobj-css'

vim-textobj-css's People

Contributors

jasonlong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

steven-liou

vim-textobj-css's Issues

License?

Could you please add a license to clarify how this can be used, e.g. the Vim license or the Apache 2.0 license?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.