mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-14 04:43:48 -05:00
vim-easy-align
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
vim-lesser-align *vim-lesser-align* *lesser-align*
|
||||
vim-easy-align *vim-easy-align* *easy-align*
|
||||
=========================================================================
|
||||
|
||||
Author: Junegunn Choi <https://github.com/junegunn>
|
||||
@@ -6,36 +6,37 @@ Author: Junegunn Choi <https://github.com/junegunn>
|
||||
Yet another Vim alignment plugin without too much ambition.
|
||||
|
||||
This plugin clearly has less features than the other pre-existing ones
|
||||
with the similar goals, but it is simpler, easier to use, and good enough
|
||||
(or even better) for the most of the cases.
|
||||
with the similar goals, but it is simpler, easier to use,
|
||||
and just good enough for the most of the cases.
|
||||
|
||||
https://github.com/junegunn/vim-lesser-align
|
||||
https://github.com/junegunn/vim-easy-align
|
||||
|
||||
|
||||
LesserAlign *LesserAlign*
|
||||
EasyAlign *EasyAlign*
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Vim-lesser-align defines `LesserAlign` command in the visual mode.
|
||||
For convenience, it is advised that you define a mapping for triggering
|
||||
it in your .vimrc.
|
||||
Vim-easy-align defines `:EasyAlign` command in the visual mode.
|
||||
|
||||
vnoremap <silent> <Enter> :LesserAlign<cr>
|
||||
For convenience, it is advised that you define a mapping for triggering it
|
||||
in your `.vimrc`.
|
||||
|
||||
Then a key sequence becomes a combination of 3 parts.
|
||||
vnoremap <silent> <Enter> :EasyAlign<cr>
|
||||
|
||||
1. <Enter>
|
||||
- Shortcut for `:LesserAssign<cr>`
|
||||
2. Integer (optional, default: 1)
|
||||
1 Alignment around 1st delimiter
|
||||
2 Alignment around 2nd delimiter
|
||||
With this mapping, you can align selected lines with a few keystrokes.
|
||||
|
||||
1. <Enter> key to start EasyAlign command
|
||||
2. Optional field number (default: 1)
|
||||
1 Alignment around 1st delimiter
|
||||
2 Alignment around 2nd delimiter
|
||||
...
|
||||
* Alignment around all delimiters (tabularize)
|
||||
* Alignment around all delimiters (recursive)
|
||||
3. Delimiter
|
||||
= Operators containing equals sign (=, ==, !=, +=, &&=, ...)
|
||||
<space>
|
||||
:
|
||||
,
|
||||
|
|
||||
<space> General alignment around whitespaces
|
||||
= Operators containing equals sign (=, ==, !=, +=, &&=, ...)
|
||||
: Suitable for formatting JSON or YAML
|
||||
. Multi-line method chaining
|
||||
, Multi-line method arguments. CSV.
|
||||
| Table markdown
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -51,7 +52,8 @@ Examples:
|
||||
Defining custom alignment rules
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
let g:lesser_align_delimiters = {
|
||||
let g:easy_align_delimiters = {
|
||||
\ '/': { 'pattern': '//*' },
|
||||
\ 'x': {
|
||||
\ 'pattern': '[xX]',
|
||||
\ 'margin_left': ' <<<',
|
||||
@@ -59,3 +61,4 @@ Defining custom alignment rules
|
||||
\ 'stick_to_left': 0
|
||||
\ }
|
||||
\ }
|
||||
|
||||
Reference in New Issue
Block a user