mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-10 10:53:49 -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)
|
||||
- `[:;]\+`
|
||||
|
||||
#### Options in shortcut expression
|
||||
#### Options in shorthand notation
|
||||
|
||||
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,
|
||||
|
||||
@@ -238,7 +238,7 @@ can also be written as
|
||||
|
||||
- `:EasyAlign*/[:;]\+/s1l0`
|
||||
|
||||
Supported shortcut expressions are listed below.
|
||||
Supported shorthand notations are listed below.
|
||||
|
||||
| Expression | Option |
|
||||
| ---------- | ---------------- |
|
||||
@@ -250,6 +250,10 @@ Supported shortcut expressions are listed below.
|
||||
| `m[lrc*]*` | mode_sequence |
|
||||
| `i[ksdn]` | indentation |
|
||||
|
||||
Notice that some option values cannot be expressed in shorthand notation.
|
||||
|
||||
- `:EasyAlign*/[:;]\+/s1l0 {'ig': []}`
|
||||
|
||||
### Partial alignment in blockwise-visual mode
|
||||
|
||||
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:
|
||||
|
||||
- :EasyAlign /[:;]\+/
|
||||
- :EasyAlign 2/[:;]\+/
|
||||
- :EasyAlign */[:;]\+/
|
||||
- :EasyAlign **/[:;]\+/
|
||||
:EasyAlign /[:;]\+/
|
||||
:EasyAlign 2/[:;]\+/
|
||||
:EasyAlign */[:;]\+/
|
||||
:EasyAlign **/[:;]\+/
|
||||
|
||||
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
|
||||
format.
|
||||
|
||||
- :EasyAlign * /[:;]\+/ { 'stick_to_left': 1, 'left_margin': 0 }
|
||||
:EasyAlign * /[:;]\+/ { 'stick_to_left': 1, 'left_margin': 0 }
|
||||
|
||||
Then we get:
|
||||
|
||||
@@ -137,33 +137,33 @@ Then we get:
|
||||
|
||||
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):
|
||||
|
||||
- :EasyAlign*/[:;]\+/{'s':1,'l':''}
|
||||
:EasyAlign*/[:;]\+/{'s':1,'l':''}
|
||||
|
||||
The same thing can be done in the interactive mode as well with the following
|
||||
key combination.
|
||||
|
||||
- <Enter>
|
||||
- *
|
||||
- <Left>
|
||||
- <CTRL-/> (or <CTRL-X> on GVim)
|
||||
- [:;]\+
|
||||
- <Enter>
|
||||
- *
|
||||
- <Left>
|
||||
- <CTRL-/> (or <CTRL-X> on GVim)
|
||||
- [:;]\+
|
||||
|
||||
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,
|
||||
|
||||
- :EasyAlign*/[:;]\+/{'s':1,'l':0}
|
||||
:EasyAlign*/[:;]\+/{'s':1,'l':0}
|
||||
|
||||
can also be written as
|
||||
|
||||
- :EasyAlign*/[:;]\+/s1l0
|
||||
:EasyAlign*/[:;]\+/s1l0
|
||||
|
||||
Supported shortcut expressions are listed below.
|
||||
Supported shorthand notations are listed below.
|
||||
|
||||
| Expression | Option |
|
||||
| ---------- | -------------- |
|
||||
@@ -172,9 +172,13 @@ Supported shortcut expressions are listed below.
|
||||
| s[01] | stick_to_left |
|
||||
| u[01] | ignore_unmatched |
|
||||
| d[lrc] | delimiter_align |
|
||||
| m[lrc*]* | mode_sequence |
|
||||
| m[lrc*]+ | mode_sequence |
|
||||
| i[ksdn] | indentation |
|
||||
|
||||
Notice that some option values cannot be expressed in shorthand notation.
|
||||
|
||||
:EasyAlign*/[:;]\+/s1l0 {'ig': []}
|
||||
|
||||
|
||||
Partial alignment in blockwise-visual mode
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user