tabular: add examples

This commit is contained in:
Rico Sta. Cruz 2017-10-11 15:42:24 +08:00
parent 29dc21cb26
commit da34aa0572
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 70 additions and 10 deletions

View File

@ -8,43 +8,103 @@ intro: |
[Tabular](https://github.com/godlygeek/tabular) is a Vim script for text alignment. [Tabular](https://github.com/godlygeek/tabular) is a Vim script for text alignment.
--- ---
## Examples ## Common usage
{: .-three-column}
### Tables
```
:Tab /|
```
{: .-setup}
```
| Fruit | Color |
| ----- | ----- |
| Apple | Red |
| Banana | Yellow |
| Kiwi | Green |
```
### Variables
```
:Tab /=
```
{: .-setup}
```
title = "Hello"
src = "image.jpg"
width = 640
```
### Colons
```
:Tab /:\zs/l0l1
```
{: .-setup}
```
title: "Hello world"
description: "This is a description"
src: "image.jpg"
height: 320
width: 640
```
## Tab command
{: .-three-column} {: .-three-column}
### Basic example ### Basic example
``` ```
:Tab /, :Tab /:
``` ```
{: .-setup} {: .-setup}
```bash ```bash
hello , there title : My picture
hi , you src : img.jpg
``` ```
### Right align ### Right align
``` ```
:Tab /,/r0 :Tab /:/r0
``` ```
{: .-setup} {: .-setup}
```bash ```bash
hello,there title:My picture
hi, you src: img.jpg
``` ```
### The \zs atom
```
:Tab /:\zs
```
{: .-setup}
```
title: My picture
src: img.jpg
```
The `\zs` atom will exclude the `:` from the search match.
### Specifier ### Specifier
``` ```
:Tab /,/r1c1l0 :Tab /:/r1c1l0
``` ```
{: .-setup} {: .-setup}
```bash ```bash
hello , etc title : My picture
hi , etc src : img.jpg
``` ```
#### Explanation #### Explanation