title | category | layout | updated | weight | intro |
---|---|---|---|---|---|
Tabular |
Vim |
2017/sheet |
2017-10-11 |
-1 |
[Tabular](https://github.com/godlygeek/tabular) is a Vim script for text alignment.
|
{: .-three-column}
:Tab /|
{: .-setup}
| Fruit | Color |
| ----- | ----- |
| Apple | Red |
| Banana | Yellow |
| Kiwi | Green |
:Tab /=
{: .-setup}
title = "Hello"
src = "image.jpg"
width = 640
:Tab /:\zs/l0l1
{: .-setup}
title: "Hello world"
description: "This is a description"
src: "image.jpg"
height: 320
width: 640
{: .-three-column}
:Tab /:
{: .-setup}
title : My picture
src : img.jpg
:Tab /:/r0
{: .-setup}
title:My picture
src: img.jpg
:Tab /:\zs
{: .-setup}
title: My picture
src: img.jpg
The \zs
atom will exclude the :
from the search match.
:Tab /:/r1c1l0
{: .-setup}
title : My picture
src : img.jpg
r1
-- Right align with 1 spacec1
-- Center align the comma with 1 spacel0
-- Left align with 0 spaces
:Tab /^[^,]*\zs,/r0
{: .-setup}
abc,hello
c,hi there
a,yo
Specifier | Description |
---|---|
r1c1l0 |
multiple specifiers, one per column (the separator counts as a column) |
--- | --- |
lN |
Left-align (with N spaces padding) |
rN |
Right-align (with N spaces padding) |
cN |
Center-align (with N spaces padding) |
- godlygeek/tabular (github.com)
- Aligning text with Tabular.vim (vimcasts.org)