Skip to content

Commit 10f8bc2

Browse files
committed
Use Prettier for formatting the README
1 parent 15294ad commit 10f8bc2

File tree

2 files changed

+15
-49
lines changed

2 files changed

+15
-49
lines changed

.prettierrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Disable formatting of quoted code embedded in a file because it breaks sample codes in the README.md.
2+
# https://prettier.io/docs/en/options.html#embedded-language-formatting
3+
embeddedLanguageFormatting: off

README.md

+12-49
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@
33
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
44
[![test](https://github.com/kg8m/vim-simple-align/actions/workflows/test.yml/badge.svg)](https://github.com/kg8m/vim-simple-align/actions/workflows/test.yml)
55

6-
7-
vim-simple-align
8-
==================================================
6+
# vim-simple-align
97

108
A Vim/Neovim plugin to align texts by simple way.
119

12-
* vim-simple-align provides only 1 command and a few its options
13-
* no need to remember options because they can be completed
14-
* delimiter used to split texts is always Vim's regular expression
10+
- vim-simple-align provides only 1 command and a few its options
11+
- no need to remember options because they can be completed
12+
- delimiter used to split texts is always Vim's regular expression
1513

1614
vim-simple-align doesn't cover all alignment cases but aims to work nice in many common cases.
1715

1816
https://user-images.githubusercontent.com/694547/119252181-beec6380-bbe5-11eb-87ce-4ed643598962.mp4
1917

20-
21-
Commands/Usage
22-
--------------------------------------------------
18+
## Commands/Usage
2319

2420
vim-simple-align provides only 1 command: `:SimpleAlign`.
2521

@@ -39,7 +35,6 @@ Delimiter is Vim's regular expression. Some characters may need to be escaped.
3935

4036
cf. `:h regular-expression`
4137

42-
4338
### Options
4439

4540
#### `-count` (`-c`) option
@@ -48,30 +43,25 @@ cf. `:h regular-expression`
4843

4944
Default: `-1`
5045

51-
5246
#### `-lpadding` (`-l`) option
5347

5448
`-lpadding` option means how many spaces to put left padding of each token. Available values are integers greater than or equal to 0.
5549

5650
Default: `1`
5751

58-
5952
#### `-rpadding` (`-r`) option
6053

6154
`-rpadding` option means how many spaces to put right padding of each token. Available values are integers greater than or equal to 0.
6255

6356
Default: `1`
6457

65-
6658
#### `-justify` (`-j`) option
6759

6860
`-justify` option means which side tokens should be on. Available values are `left` and `right`.
6961

7062
Default: `left`
7163

72-
73-
Examples
74-
--------------------------------------------------
64+
## Examples
7565

7666
### Align Markdown table
7767

@@ -91,14 +81,12 @@ a | bbb | ccccc
9181
| .. | .. | .. |
9282
```
9383

94-
9584
#### 🔧 Command
9685

9786
```vim
9887
:1,4SimpleAlign |
9988
```
10089

101-
10290
#### ⭕️ Aligned
10391

10492
```md
@@ -115,7 +103,6 @@ a | bbb | ccccc
115103
| .. | .. | .. |
116104
```
117105

118-
119106
### Align Markdown table with justifying to right
120107

121108
#### ❌ Not aligned
@@ -134,14 +121,12 @@ a | bbb | ccccc
134121
| .. | .. | .. |
135122
```
136123

137-
138124
#### 🔧 Command
139125

140126
```vim
141127
:1,4SimpleAlign | -justify right
142128
```
143129

144-
145130
#### ⭕️ Aligned
146131

147132
```md
@@ -158,7 +143,6 @@ a | bbb | ccccc
158143
| .. | .. | .. |
159144
```
160145

161-
162146
### Align JSON, dictionary/hash items
163147

164148
#### ❌ Not aligned
@@ -193,7 +177,6 @@ Ruby old Hash syntax:
193177
}
194178
```
195179

196-
197180
#### 🔧 Command
198181

199182
For JSON:
@@ -214,7 +197,6 @@ For Ruby old Hash syntax:
214197
:2,4SimpleAlign =>
215198
```
216199

217-
218200
#### ⭕️ Aligned
219201

220202
JSON:
@@ -247,7 +229,6 @@ Ruby old Hash syntax:
247229
}
248230
```
249231

250-
251232
### Align variable assignments
252233

253234
#### ❌ Not aligned
@@ -276,7 +257,6 @@ a = "a"
276257
a += "a"
277258
```
278259

279-
280260
#### 🔧 Command
281261

282262
For basic case:
@@ -297,7 +277,6 @@ For `=` and `+=`:
297277
:1,2SimpleAlign [+\ ]=
298278
```
299279

300-
301280
#### ⭕️ Aligned
302281

303282
Basic case:
@@ -324,7 +303,6 @@ a = "a"
324303
a += "a"
325304
```
326305

327-
328306
### Align output/result comments
329307

330308
#### ❌ Not aligned
@@ -345,7 +323,6 @@ bbb #=> "bbb"
345323
ccccc #=> "ccccc"
346324
```
347325

348-
349326
#### 🔧 Command
350327

351328
For JavaScript:
@@ -360,7 +337,6 @@ For Ruby:
360337
:1,3SimpleAlign #=> -lpadding 2
361338
```
362339

363-
364340
#### ⭕️ Aligned
365341

366342
JavaScript:
@@ -379,7 +355,6 @@ bbb #=> "bbb"
379355
ccccc #=> "ccccc"
380356
```
381357

382-
383358
### Align non-whitespace characters
384359

385360
#### ❌ Not aligned
@@ -391,14 +366,12 @@ t.boolean :active, null: false, default: true
391366
t.boolean :foo, null: true, default: false
392367
```
393368

394-
395369
#### 🔧 Command
396370

397371
```vim
398372
:1,4SimpleAlign \S\+ -lpadding 0
399373
```
400374

401-
402375
#### ⭕️ Aligned
403376

404377
```rb
@@ -408,21 +381,15 @@ t.boolean :active, null: false, default: true
408381
t.boolean :foo, null: true, default: false
409382
```
410383

384+
## Inspired by alignta
411385

412-
Inspired by alignta
413-
--------------------------------------------------
414-
415-
vim-simple-align is inspired by [h1mesuke/vim-alignta](<https://github.com/h1mesuke/vim-alignta>). It is a simple Vim plugin to align texts. It provides only 1 command `:Alignta` and has a few options and command syntaxes. It is a very great plugin but doesn't work on current Vim. vim-simple-align inherits its philosophy and focuses its limited essential features.
416-
386+
vim-simple-align is inspired by [h1mesuke/vim-alignta](https://github.com/h1mesuke/vim-alignta). It is a simple Vim plugin to align texts. It provides only 1 command `:Alignta` and has a few options and command syntaxes. It is a very great plugin but doesn't work on current Vim. vim-simple-align inherits its philosophy and focuses its limited essential features.
417387

418-
Why not vim-easy-align?
419-
--------------------------------------------------
388+
## Why not vim-easy-align?
420389

421390
Yes, [vim-easy-align](https://github.com/junegunn/vim-easy-align) is a great Vim plugin. However, it is complicated and difficult for me. I can't remember its mappings, options, and syntaxes. It is a so cool product, but not for me.
422391

423-
424-
Installation
425-
--------------------------------------------------
392+
## Installation
426393

427394
If you use [dein.vim](https://github.com/Shougo/dein.vim):
428395

@@ -432,18 +399,14 @@ call dein#add("kg8m/vim-simple-align")
432399

433400
Note: dein.vim's lazy loading feature with `on_cmd` option is not recommended for vim-simple-align. You will see `E471: Argument required: ...` if so. To tell the truth, lazy loading of vim-simple-align doesn't make Vim's startup faster. On the one hand, vim-simple-align just defines 1 command when added to `runtimepath`. On the other hand, dein.vim's lazy loading with `on_cmd` also defines a dummy command.
434401

435-
436-
Vim9 script
437-
--------------------------------------------------
402+
## Vim9 script
438403

439404
You can use Vim9 script version if you use Vim 8.2.4053+. Vim9 script version is 5-10 times faster than legacy Vim script version. Vim9 script version is available on [`vim9` branch](https://github.com/kg8m/vim-simple-align/tree/vim9).
440405

441406
```vim
442407
call dein#add("kg8m/vim-simple-align", { "rev": "vim9" })
443408
```
444409

445-
446-
Requirements
447-
--------------------------------------------------
410+
## Requirements
448411

449412
Vim 8.2+ or Neovim nightly

0 commit comments

Comments
 (0)