-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalith.txt
133 lines (114 loc) · 2.77 KB
/
alith.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
*alith.txt* A text-align plugin for Vim9
Maintainer: mityu
License: MIT License
==============================================================================
CONTENTS *alith-contents*
INTRODUCTION |alith-introduction|
REQUIREMENTS |alith-requirements|
COMMANDS |alith-commands|
CUSTOMIZE |alith-customize|
==============================================================================
INTRODUCTION *alith-introduction*
*alith* is a Vim plugin to align texts.
Align text by ",": >
a, bbb, c
aa, b, ccc
<
|
| `:%Alith ,`
v
>
a , bbb, c
aa, b , ccc
<
Align text by "|": >
|AAA|BBB|CCC|
|:--|:-:|--:|
|a|b|c|
<
|
| `:%Alith |`
v
>
|AAA|BBB|CCC|
|:--|:-:|--:|
|a |b |c |
<
==============================================================================
REQUIREMENTS *alith-requirements*
- Vim 9.0.0000 or later.
- |+textprop|
- |+popupwin|
- |+reltime|
Note that since this plugin is written in |Vim9-script|, this plugin does not
work on Neovim.
==============================================================================
COMMANDS *alith-commands*
:[range]Alith [{regex}] *:Alith*
Format text between [range].
The text separator can be specified as {regex}. If {regex} is omitted,
the |input()| dialog is opened to input {regex}. With this dialog, the
matched text will be highlighted interactively like the 'incsearch'
feature. If the elapsed time to highlight matches overs 'redrawtime',
this plugin automatically gives up highlight all matches in order not
to freeze Vim.
Examples:
- Align text by ",": >
a, bbb, c
aa, b, ccc
<
|
| `:%Alith ,`
v
>
a , bbb, c
aa, b , ccc
<
- Align text by "\" or the EOL: >
hoge \
foo \
piyopiyo
<
|
| `:%Alith \\\?$`
v
>
hoge \
foo \
piyopiyo
<
- |/\zs| is useful to align text by after some text. Align text by
after ":": >
hoge: fuga
foo: bar
<
|
| `:%Alith :\zs`
v
>
hoge: fuga
foo: bar
<
==============================================================================
CUSTOMIZE *alith-customize*
You can change colors for highlight matched text with the following highlight
groups.
AlithMatch *hl-AlithMatch*
(Default: |hl-Search|)
Used to highlight matched text.
AlithMatchHead *hl-AlithMatchHead*
(Default: |hl-IncSearch|)
Used to highlight the first character of matched text.
Example:
Colors for highlighting matched text, "abcdefg": >
abcdefg
*~~~~~~
^ ^
| |
| AlithMatch
|
|
AlithMatchHead
<
==============================================================================
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl