From 06d5bcb911b314b2f55498f3ef336a1a6aae70b9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 4 Aug 2013 18:04:56 +0900 Subject: [PATCH] Rename :EasyAlignRight to :EasyAlign! --- README.md | 34 +++++++++++++++++----------------- doc/easy_align.txt | 6 +++--- plugin/easy_align.vim | 3 +-- test/regexp.script | 2 +- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3decb8b..3444eee 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ Bundle 'junegunn/vim-easy-align' Usage ----- -_vim-easy-align_ defines `:EasyAlign` and `:EasyAlignRight` commands in the -visual mode. +_vim-easy-align_ defines `:EasyAlign` command (and the right-justification +variant `:EasyAlign!`) in the visual mode. | Mode | Command | | ------------------------- | --------------------------------------------- | @@ -46,7 +46,7 @@ visual mode. ### Interactive mode -The commands will go into the interactive mode when no argument is given. +The command will go into the interactive mode when no argument is given. For convenience, it is advised that you define a mapping for triggering it in your `.vimrc`. @@ -82,20 +82,20 @@ Alignment rules for the following delimiters have been defined to meet the most #### Example command sequences -| With visual map | Description | Equivalent command | -| ------------------- | -------------------------------------------------------- | ------------------------- | -| `` | Alignment around 1st whitespaces | `:'<,'>EasyAlign\ ` | -| `2` | Alignment around 2nd whitespaces | `:'<,'>EasyAlign2\ ` | -| `-` | Alignment around the last whitespaces | `:'<,'>EasyAlign-\ ` | -| `:` | Alignment around 1st colon | `:'<,'>EasyAlign:` | -| `=` | Alignment around 1st equals signs (and the likes) | `:'<,'>EasyAlign=` | -| `2=` | Alignment around 2nd equals signs (and the likes) | `:'<,'>EasyAlign2=` | -| `3=` | Alignment around 3rd equals signs (and the likes) | `:'<,'>EasyAlign3=` | -| `*=` | Alignment around all equals signs (and the likes) | `:'<,'>EasyAlign*=` | -| `**=` | Left-right alternating alignment around all equals signs | `:'<,'>EasyAlign**=` | -| `=` | Right-justified alignment around 1st equals signs | `:'<,'>EasyAlignRight=` | -| `**=` | Right-left alternating alignment around all equals signs | `:'<,'>EasyAlignRight**=` | -| ... | ... | | +| With visual map | Description | Equivalent command | +| ------------------- | -------------------------------------------------------- | --------------------- | +| `` | Alignment around 1st whitespaces | `:'<,'>EasyAlign\ ` | +| `2` | Alignment around 2nd whitespaces | `:'<,'>EasyAlign2\ ` | +| `-` | Alignment around the last whitespaces | `:'<,'>EasyAlign-\ ` | +| `:` | Alignment around 1st colon | `:'<,'>EasyAlign:` | +| `=` | Alignment around 1st equals signs (and the likes) | `:'<,'>EasyAlign=` | +| `2=` | Alignment around 2nd equals signs (and the likes) | `:'<,'>EasyAlign2=` | +| `3=` | Alignment around 3rd equals signs (and the likes) | `:'<,'>EasyAlign3=` | +| `*=` | Alignment around all equals signs (and the likes) | `:'<,'>EasyAlign*=` | +| `**=` | Left-right alternating alignment around all equals signs | `:'<,'>EasyAlign**=` | +| `=` | Right-justified alignment around 1st equals signs | `:'<,'>EasyAlign!=` | +| `**=` | Right-left alternating alignment around all equals signs | `:'<,'>EasyAlign!**=` | +| ... | ... | | ### Non-interactive mode diff --git a/doc/easy_align.txt b/doc/easy_align.txt index 1e4f316..d9d2417 100644 --- a/doc/easy_align.txt +++ b/doc/easy_align.txt @@ -7,7 +7,7 @@ A simple, easy-to-use Vim alignment plugin without too much ambition. Source: https://github.com/junegunn/vim-easy-align -EasyAlign *EasyAlign* +EasyAlign *:EasyAlign* ------------------------------------------------------------------------- vim-easy-align defines `:EasyAlign` command in the visual mode. @@ -61,10 +61,10 @@ Examples: **= Right-left alternating alignment around all equals signs -EasyAlignRight *EasyAlignRight* +EasyAlign! *:EasyAlign!* ------------------------------------------------------------------------- -EasyAlignRight is the right-justified version of EasyAlign command. +:EasyAlign! is the right-justification version of :EasyAlign command. Non-interactive mode diff --git a/plugin/easy_align.vim b/plugin/easy_align.vim index bfc257a..6e7045d 100644 --- a/plugin/easy_align.vim +++ b/plugin/easy_align.vim @@ -26,5 +26,4 @@ if exists("g:loaded_easy_align_plugin") endif let g:loaded_easy_align_plugin = 1 -command! -nargs=* -range EasyAlign ,call easy_align#align(0, ) -command! -nargs=* -range EasyAlignRight ,call easy_align#align(1, ) +command! -nargs=* -range -bang EasyAlign ,call easy_align#align('' == '!', ) diff --git a/test/regexp.script b/test/regexp.script index c979398..b735519 100644 --- a/test/regexp.script +++ b/test/regexp.script @@ -1 +1 @@ -4Gvipjyvip:EasyAlign: Pvip:EasyAlign*: Pvip:EasyAlign-: Pvip:EasyAlign * : Pvip:EasyAlign -2 : Pvip:EasyAlign -2: Pvip:easyA€kb€kb€kb€kb€kbEasAli€kb€kb€kbyAlign *: Pvip:EasyAlign; Pvip:EasyAlign /;/ Pvip:EasyAlign/;/ Pvip:EasyAlign*/;/ Pvip:e€kbEasyAlign/[:;]\+/ Pvip:EasyAlign*/[:;]\+/ Pvip:EasyAlign* /[:;]\+/ Pvip:EasyAlign */[:;]\+/ Pvip:EasyAlign * [:€kb€kb/[:;]\+/ Pvip:EasyAlign*[:;]\+€kb€kb€kb€kb€kb€kb€kb=/[€kb€kb€kb-/[:;]\+/ Pvip:EasyAlign-2/[:;\€kb\€kb]\+/ Pvip:EasyAlign/[:;]\+/{ 'ml': '<<<', 'mrr': '>>>'} Pvip:EasyAlign/[:;]\+/{'ml':''m€kb, 'stl': 1} Pvip:EasyAlign * /€kb /[:;]€kb\€kb]\+/ {'stick_to': 1, 'marl': '???', 'marr': '~~~'} Pvip:EasyAlign /../ Pvip:EasyAlign*/../ Pvip:EasyAlign ** €kb/[:;]/€kb€kb\+]/ Pvip:EasyAlign/[:;\€kb\€kb]\+/'€kb{'marginr':'____'} Pvip:EasyAlign**[€kb/[:;]\+/ Pvip:EasyAlignRight**/[:;]\+/ Pfbjfm:EasyAlign/[:;]\+/ +4Gvipjyvip:EasyAlign: Pvip:EasyAlign*: Pvip:EasyAlign-: Pvip:EasyAlign * : Pvip:EasyAlign -2 : Pvip:EasyAlign -2: Pvip:easyA€kb€kb€kb€kb€kbEasAli€kb€kb€kbyAlign *: Pvip:EasyAlign; Pvip:EasyAlign /;/ Pvip:EasyAlign/;/ Pvip:EasyAlign*/;/ Pvip:e€kbEasyAlign/[:;]\+/ Pvip:EasyAlign*/[:;]\+/ Pvip:EasyAlign* /[:;]\+/ Pvip:EasyAlign */[:;]\+/ Pvip:EasyAlign * [:€kb€kb/[:;]\+/ Pvip:EasyAlign*[:;]\+€kb€kb€kb€kb€kb€kb€kb=/[€kb€kb€kb-/[:;]\+/ Pvip:EasyAlign-2/[:;\€kb\€kb]\+/ Pvip:EasyAlign/[:;]\+/{ 'ml': '<<<', 'mrr': '>>>'} Pvip:EasyAlign/[:;]\+/{'ml':''m€kb, 'stl': 1} Pvip:EasyAlign * /€kb /[:;]€kb\€kb]\+/ {'stick_to': 1, 'marl': '???', 'marr': '~~~'} Pvip:EasyAlign /../ Pvip:EasyAlign*/../ Pvip:EasyAlign ** €kb/[:;]/€kb€kb\+]/ Pvip:EasyAlign/[:;\€kb\€kb]\+/'€kb{'marginr':'____'} Pvip:EasyAlign**[€kb/[:;]\+/ Pvip:EasyAlign!**/[:;]\+/ Pfbjfm:EasyAlign/[:;]\+/