Update README

This commit is contained in:
Junegunn Choi
2013-08-19 10:55:21 +09:00
parent 481a88f601
commit 659e2ff513
2 changed files with 32 additions and 26 deletions

View File

@@ -66,7 +66,7 @@ vnoremap <silent> <Enter> :EasyAlign<cr>
With the mapping, you can align selected lines of text with only a few keystrokes. With the mapping, you can align selected lines of text with only a few keystrokes.
1. `<Enter>` key to start interactive EasyAlign command 1. `<Enter>` key to start interactive EasyAlign command
1. Optional Enter keys to select align mode (left, right, or center) 1. Optional Enter keys to select alignment mode (left, right, or center)
1. Optional field number (default: 1) 1. Optional field number (default: 1)
- `1` Around the 1st occurrences of delimiters - `1` Around the 1st occurrences of delimiters
- `2` Around the 2nd occurrences of delimiters - `2` Around the 2nd occurrences of delimiters
@@ -410,17 +410,19 @@ eggplant = 5
Notice that `idt` is fuzzy-matched to `indentation`. Notice that `idt` is fuzzy-matched to `indentation`.
### Left/right/center mode transition in interactive mode ### Left/right/center mode switch in interactive mode
In interactive mode, you can choose the alignment mode you want by pressing In interactive mode, you can choose the alignment mode you want by pressing
enter keys. When started with the non-bang command (`:EasyAlign`), it will enter keys. The non-bang command, `:EasyAlign` starts in left-alignment mode
start in left-align mode, and as you press enter keys, it will change to and changes to right and center mode as you press enter keys, while the bang
right-align mode, then to center-align mode, and then to left mode again. version first starts in right-alignment mode.
(`['l', 'r', 'c']`)
With the bang-command (`:EasyAlign!`), it will start in right-align mode,
then goes to left and center mode. (`['r', 'l', 'c']`)
If you don't prefer this default mode transition, you can define your own - `:EasyAlign`
- Left, Right, Center
- `:EasyAlign!`
- Right, Left, Center
If you do not prefer this default mode transition, you can define your own
settings as follows. settings as follows.
```vim ```vim
@@ -430,8 +432,8 @@ let g:easy_align_bang_interactive_modes = ['c', 'r']
### Alignments over multiple occurrences of delimiters ### Alignments over multiple occurrences of delimiters
As we have seen before, you can use 'field number' to target specific As stated above, "field number" is used to target specific occurrences of
occurrences of delimiters when the lines contain multiple delimiters. the delimiter when it appears multiple times in each line.
To recap: To recap:
@@ -455,8 +457,8 @@ To recap:
:EasyAlign! **= :EasyAlign! **=
``` ```
In addition to these, with `mode_sequence` option, you can perform alignments In addition to these, you can fine-tune alignments over multiple occurrences of
over multiple occurrences of the delimiters. the delimiters with 'mode_sequence' option.
```vim ```vim
" Left alignment over the first two occurrences of delimiters " Left alignment over the first two occurrences of delimiters

View File

@@ -35,7 +35,7 @@ your `.vimrc`.
With this mapping, you can align selected lines of text with a few keystrokes. With this mapping, you can align selected lines of text with a few keystrokes.
1. <Enter> key to start interactive EasyAlign command 1. <Enter> key to start interactive EasyAlign command
2. Optional Enter keys to select align mode (left, right, or center) 2. Optional Enter keys to select alignment mode (left, right, or center)
3. Optional field number (default: 1) 3. Optional field number (default: 1)
1 Around the 1st occurrences of delimiters 1 Around the 1st occurrences of delimiters
2 Around the 2nd occurrences of delimiters 2 Around the 2nd occurrences of delimiters
@@ -129,6 +129,8 @@ Available options are as follows.
| | | (right, left, center) | | | | (right, left, center) |
| indentation | string | 'k' | | indentation | string | 'k' |
| | | (keep, shallow, deep, none) | | | | (keep, shallow, deep, none) |
| mode_sequence | string | (Depends on field number and |
| | | selected alignment mode) |
Partial alignment in blockwise-visual mode Partial alignment in blockwise-visual mode
@@ -316,20 +318,22 @@ But then again we have 'indentation' option. See the following example.
Notice that 'idt' is fuzzy-matched to 'indentation'. Notice that 'idt' is fuzzy-matched to 'indentation'.
Left/right/center mode transition in interactive mode Left/right/center mode switch in interactive mode
------------------------------------------------------------------------- -------------------------------------------------------------------------
*g:easy_align_interactive_modes* *g:easy_align_interactive_modes*
*g:easy_align_bang_interactive_modes* *g:easy_align_bang_interactive_modes*
In interactive mode, you can choose the alignment mode you want by pressing In interactive mode, you can choose the alignment mode you want by pressing
enter keys. When started with the non-bang command (`:EasyAlign`), it will enter keys. The non-bang command, `:EasyAlign` starts in left-alignment mode
start in left-align mode, and as you press enter keys, it will change to and changes to right and center mode as you press enter keys, while the bang
right-align mode, then to center-align mode, and then to left mode again. version first starts in right-alignment mode.
(['l', 'r', 'c'])
With the bang-command (`:EasyAlign!`), it will start in right-align mode,
then goes to left and center mode. (['r', 'l', 'c'])
If you don't prefer this default mode transition, you can define your own - `:EasyAlign`
- Left, Right, Center
- `:EasyAlign!`
- Right, Left, Center
If you do not prefer this default mode transition, you can define your own
settings as follows. settings as follows.
let g:easy_align_interactive_modes = ['l', 'r'] let g:easy_align_interactive_modes = ['l', 'r']
@@ -339,8 +343,8 @@ settings as follows.
Alignments over multiple occurrences of delimiters Alignments over multiple occurrences of delimiters
------------------------------------------------------------------------- -------------------------------------------------------------------------
As we have seen before, you can use 'field number' to target specific As stated above, "field number" is used to target specific occurrences of
occurrences of delimiters when the lines contain multiple delimiters. the delimiter when it appears multiple times in each line.
To recap: To recap:
@@ -362,8 +366,8 @@ To recap:
" Right-left ALTERNATING alignment around all occurrences of delimiters " Right-left ALTERNATING alignment around all occurrences of delimiters
:EasyAlign! **= :EasyAlign! **=
In addition to these, with 'mode_sequence' option, you can perform alignments In addition to these, you can fine-tune alignments over multiple occurrences of
over multiple occurrences of the delimiters. the delimiters with 'mode_sequence' option.
" Left alignment over the first two occurrences of delimiters " Left alignment over the first two occurrences of delimiters
:EasyAlign = { 'mode_sequence': 'll' } :EasyAlign = { 'mode_sequence': 'll' }