mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-10 19:03:50 -05:00
Update doc
This commit is contained in:
10
README.md
10
README.md
@@ -225,10 +225,10 @@ key combination.
|
|||||||
- `<CTRL-/>` (or `<CTRL-X>` on GVim)
|
- `<CTRL-/>` (or `<CTRL-X>` on GVim)
|
||||||
- `[:;]\+`
|
- `[:;]\+`
|
||||||
|
|
||||||
#### Options in shortcut expression
|
#### Options in shorthand notation
|
||||||
|
|
||||||
When you use regular expression in command line, options dictionary can be
|
When you use regular expression in command line, options dictionary can be
|
||||||
written concisely using shortcut expression.
|
written concisely using shorthand notation.
|
||||||
|
|
||||||
For example, the command we saw in the previous section,
|
For example, the command we saw in the previous section,
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ can also be written as
|
|||||||
|
|
||||||
- `:EasyAlign*/[:;]\+/s1l0`
|
- `:EasyAlign*/[:;]\+/s1l0`
|
||||||
|
|
||||||
Supported shortcut expressions are listed below.
|
Supported shorthand notations are listed below.
|
||||||
|
|
||||||
| Expression | Option |
|
| Expression | Option |
|
||||||
| ---------- | ---------------- |
|
| ---------- | ---------------- |
|
||||||
@@ -250,6 +250,10 @@ Supported shortcut expressions are listed below.
|
|||||||
| `m[lrc*]*` | mode_sequence |
|
| `m[lrc*]*` | mode_sequence |
|
||||||
| `i[ksdn]` | indentation |
|
| `i[ksdn]` | indentation |
|
||||||
|
|
||||||
|
Notice that some option values cannot be expressed in shorthand notation.
|
||||||
|
|
||||||
|
- `:EasyAlign*/[:;]\+/s1l0 {'ig': []}`
|
||||||
|
|
||||||
### Partial alignment in blockwise-visual mode
|
### Partial alignment in blockwise-visual mode
|
||||||
|
|
||||||
In blockwise-visual mode (`CTRL-V`), EasyAlign command aligns only the selected
|
In blockwise-visual mode (`CTRL-V`), EasyAlign command aligns only the selected
|
||||||
|
|||||||
@@ -119,16 +119,16 @@ For example, when aligning the following lines around colons and semi-colons,
|
|||||||
|
|
||||||
try these commands:
|
try these commands:
|
||||||
|
|
||||||
- :EasyAlign /[:;]\+/
|
:EasyAlign /[:;]\+/
|
||||||
- :EasyAlign 2/[:;]\+/
|
:EasyAlign 2/[:;]\+/
|
||||||
- :EasyAlign */[:;]\+/
|
:EasyAlign */[:;]\+/
|
||||||
- :EasyAlign **/[:;]\+/
|
:EasyAlign **/[:;]\+/
|
||||||
|
|
||||||
Notice that you can't append '\zs' to your regular expression to put delimiters
|
Notice that you can't append '\zs' to your regular expression to put delimiters
|
||||||
on the left. It can be done by providing additional options in Vim dictionary
|
on the left. It can be done by providing additional options in Vim dictionary
|
||||||
format.
|
format.
|
||||||
|
|
||||||
- :EasyAlign * /[:;]\+/ { 'stick_to_left': 1, 'left_margin': 0 }
|
:EasyAlign * /[:;]\+/ { 'stick_to_left': 1, 'left_margin': 0 }
|
||||||
|
|
||||||
Then we get:
|
Then we get:
|
||||||
|
|
||||||
@@ -137,33 +137,33 @@ Then we get:
|
|||||||
|
|
||||||
Option names are fuzzy-matched, so you can write as follows:
|
Option names are fuzzy-matched, so you can write as follows:
|
||||||
|
|
||||||
- :EasyAlign * /[:;]\+/ { 'stl': 1, 'l': '' }
|
:EasyAlign * /[:;]\+/ { 'stl': 1, 'l': '' }
|
||||||
|
|
||||||
You can even omit spaces between the arguments, so concisely (or cryptically):
|
You can even omit spaces between the arguments, so concisely (or cryptically):
|
||||||
|
|
||||||
- :EasyAlign*/[:;]\+/{'s':1,'l':''}
|
:EasyAlign*/[:;]\+/{'s':1,'l':''}
|
||||||
|
|
||||||
The same thing can be done in the interactive mode as well with the following
|
The same thing can be done in the interactive mode as well with the following
|
||||||
key combination.
|
key combination.
|
||||||
|
|
||||||
- <Enter>
|
- <Enter>
|
||||||
- *
|
- *
|
||||||
- <Left>
|
- <Left>
|
||||||
- <CTRL-/> (or <CTRL-X> on GVim)
|
- <CTRL-/> (or <CTRL-X> on GVim)
|
||||||
- [:;]\+
|
- [:;]\+
|
||||||
|
|
||||||
When you use regular expression in command line, options dictionary can be
|
When you use regular expression in command line, options dictionary can be
|
||||||
written concisely using shortcut expression.
|
written concisely using shorthand notation.
|
||||||
|
|
||||||
For example, the command we saw in the previous section,
|
For example, the command we saw in the previous section,
|
||||||
|
|
||||||
- :EasyAlign*/[:;]\+/{'s':1,'l':0}
|
:EasyAlign*/[:;]\+/{'s':1,'l':0}
|
||||||
|
|
||||||
can also be written as
|
can also be written as
|
||||||
|
|
||||||
- :EasyAlign*/[:;]\+/s1l0
|
:EasyAlign*/[:;]\+/s1l0
|
||||||
|
|
||||||
Supported shortcut expressions are listed below.
|
Supported shorthand notations are listed below.
|
||||||
|
|
||||||
| Expression | Option |
|
| Expression | Option |
|
||||||
| ---------- | -------------- |
|
| ---------- | -------------- |
|
||||||
@@ -172,9 +172,13 @@ Supported shortcut expressions are listed below.
|
|||||||
| s[01] | stick_to_left |
|
| s[01] | stick_to_left |
|
||||||
| u[01] | ignore_unmatched |
|
| u[01] | ignore_unmatched |
|
||||||
| d[lrc] | delimiter_align |
|
| d[lrc] | delimiter_align |
|
||||||
| m[lrc*]* | mode_sequence |
|
| m[lrc*]+ | mode_sequence |
|
||||||
| i[ksdn] | indentation |
|
| i[ksdn] | indentation |
|
||||||
|
|
||||||
|
Notice that some option values cannot be expressed in shorthand notation.
|
||||||
|
|
||||||
|
:EasyAlign*/[:;]\+/s1l0 {'ig': []}
|
||||||
|
|
||||||
|
|
||||||
Partial alignment in blockwise-visual mode
|
Partial alignment in blockwise-visual mode
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user