https://github.com/jasonlong/vim-textobj-css
Vim text objects for CSS, Sass, etc.
https://github.com/jasonlong/vim-textobj-css
vim vim-textobj-user
Last synced: 14 days ago
JSON representation
Vim text objects for CSS, Sass, etc.
- Host: GitHub
- URL: https://github.com/jasonlong/vim-textobj-css
- Owner: jasonlong
- License: unlicense
- Created: 2016-02-18T13:52:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-14T14:12:20.000Z (about 7 years ago)
- Last Synced: 2025-06-11T12:07:38.666Z (18 days ago)
- Topics: vim, vim-textobj-user
- Language: Vim script
- Homepage:
- Size: 5.86 KB
- Stars: 32
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-textobj-css
[Text objects](http://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide/) in Vim are very useful. They allow you to modify text by word, sentence, paragraph, HTML tag, and more. [vim-textobj-user](https://github.com/kana/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.

### 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" CSSIt'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: Warning if you use vim-gitgutter :warning:
vim-gitgutter supplies some text objects for dealing with hunks and these conflict with vim-textobj-css. As the [vim-gitgutter README describes](https://github.com/airblade/vim-gitgutter#hunks), you can override those settings with something like:
```
omap ih GitGutterTextObjectInnerPending
omap ah GitGutterTextObjectOuterPending
xmap ih GitGutterTextObjectInnerVisual
xmap ah GitGutterTextObjectOuterVisual
```## Installation
This plugin requires [vim-textobj-user](https://github.com/kana/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'
```