Skip to content

Commit a8b6c5b

Browse files
committed
Merge remote-tracking branch 'origin/master' into vim9
2 parents e68eb90 + 10f8bc2 commit a8b6c5b

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
@@ -2,23 +2,19 @@
22
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
33
[![test](https://github.com/kg8m/vim-simple-align/actions/workflows/test.yml/badge.svg?branch=vim9)](https://github.com/kg8m/vim-simple-align/actions/workflows/test.yml?query=branch%3Avim9)
44

5-
6-
vim-simple-align
7-
==================================================
5+
# vim-simple-align
86

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

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

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

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

19-
20-
Commands/Usage
21-
--------------------------------------------------
17+
## Commands/Usage
2218

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

@@ -38,7 +34,6 @@ Delimiter is Vim's regular expression. Some characters may need to be escaped.
3834

3935
cf. `:h regular-expression`
4036

41-
4237
### Options
4338

4439
#### `-count` (`-c`) option
@@ -47,30 +42,25 @@ cf. `:h regular-expression`
4742

4843
Default: `-1`
4944

50-
5145
#### `-lpadding` (`-l`) option
5246

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

5549
Default: `1`
5650

57-
5851
#### `-rpadding` (`-r`) option
5952

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

6255
Default: `1`
6356

64-
6557
#### `-justify` (`-j`) option
6658

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

6961
Default: `left`
7062

71-
72-
Examples
73-
--------------------------------------------------
63+
## Examples
7464

7565
### Align Markdown table
7666

@@ -90,14 +80,12 @@ a | bbb | ccccc
9080
| .. | .. | .. |
9181
```
9282

93-
9483
#### 🔧 Command
9584

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

100-
10189
#### ⭕️ Aligned
10290

10391
```md
@@ -114,7 +102,6 @@ a | bbb | ccccc
114102
| .. | .. | .. |
115103
```
116104

117-
118105
### Align Markdown table with justifying to right
119106

120107
#### ❌ Not aligned
@@ -133,14 +120,12 @@ a | bbb | ccccc
133120
| .. | .. | .. |
134121
```
135122

136-
137123
#### 🔧 Command
138124

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

143-
144129
#### ⭕️ Aligned
145130

146131
```md
@@ -157,7 +142,6 @@ a | bbb | ccccc
157142
| .. | .. | .. |
158143
```
159144

160-
161145
### Align JSON, dictionary/hash items
162146

163147
#### ❌ Not aligned
@@ -192,7 +176,6 @@ Ruby old Hash syntax:
192176
}
193177
```
194178

195-
196179
#### 🔧 Command
197180

198181
For JSON:
@@ -213,7 +196,6 @@ For Ruby old Hash syntax:
213196
:2,4SimpleAlign =>
214197
```
215198

216-
217199
#### ⭕️ Aligned
218200

219201
JSON:
@@ -246,7 +228,6 @@ Ruby old Hash syntax:
246228
}
247229
```
248230

249-
250231
### Align variable assignments
251232

252233
#### ❌ Not aligned
@@ -275,7 +256,6 @@ a = "a"
275256
a += "a"
276257
```
277258

278-
279259
#### 🔧 Command
280260

281261
For basic case:
@@ -296,7 +276,6 @@ For `=` and `+=`:
296276
:1,2SimpleAlign [+\ ]=
297277
```
298278

299-
300279
#### ⭕️ Aligned
301280

302281
Basic case:
@@ -323,7 +302,6 @@ a = "a"
323302
a += "a"
324303
```
325304

326-
327305
### Align output/result comments
328306

329307
#### ❌ Not aligned
@@ -344,7 +322,6 @@ bbb #=> "bbb"
344322
ccccc #=> "ccccc"
345323
```
346324

347-
348325
#### 🔧 Command
349326

350327
For JavaScript:
@@ -359,7 +336,6 @@ For Ruby:
359336
:1,3SimpleAlign #=> -lpadding 2
360337
```
361338

362-
363339
#### ⭕️ Aligned
364340

365341
JavaScript:
@@ -378,7 +354,6 @@ bbb #=> "bbb"
378354
ccccc #=> "ccccc"
379355
```
380356

381-
382357
### Align non-whitespace characters
383358

384359
#### ❌ Not aligned
@@ -390,14 +365,12 @@ t.boolean :active, null: false, default: true
390365
t.boolean :foo, null: true, default: false
391366
```
392367

393-
394368
#### 🔧 Command
395369

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

400-
401374
#### ⭕️ Aligned
402375

403376
```rb
@@ -407,21 +380,15 @@ t.boolean :active, null: false, default: true
407380
t.boolean :foo, null: true, default: false
408381
```
409382

383+
## Inspired by alignta
410384

411-
Inspired by alignta
412-
--------------------------------------------------
413-
414-
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.
415-
385+
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.
416386

417-
Why not vim-easy-align?
418-
--------------------------------------------------
387+
## Why not vim-easy-align?
419388

420389
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.
421390

422-
423-
Installation
424-
--------------------------------------------------
391+
## Installation
425392

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

@@ -431,18 +398,14 @@ call dein#add("kg8m/vim-simple-align")
431398

432399
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.
433400

434-
435-
Vim9 script
436-
--------------------------------------------------
401+
## Vim9 script
437402

438403
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).
439404

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

444-
445-
Requirements
446-
--------------------------------------------------
409+
## Requirements
447410

448411
Vim 8.2+ or Neovim nightly

0 commit comments

Comments
 (0)