diff --git a/README.md b/README.md index de3fd54..4d6f65d 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ variant `:EasyAlign!`) in the visual mode. | Mode | Command | | ------------------------- | ------------------------------------------------ | -| Interactive mode | `:EasyAlign[!]` | +| Interactive mode | `:EasyAlign[!] [OPTIONS]` | | Using predefined rules | `:EasyAlign[!] [FIELD#] DELIMITER_KEY [OPTIONS]` | | Using regular expressions | `:EasyAlign[!] [FIELD#] /REGEXP/ [OPTIONS]` | @@ -61,6 +61,8 @@ your `.vimrc`. vnoremap :EasyAlign ``` +(Of course you can use any key combination as the trigger. e.g. `a`) + With the mapping, you can align selected lines of text with only a few keystrokes. 1. `` key to start interactive EasyAlign command diff --git a/autoload/easy_align.vim b/autoload/easy_align.vim index 6b21831..abd13c5 100644 --- a/autoload/easy_align.vim +++ b/autoload/easy_align.vim @@ -544,7 +544,9 @@ function! easy_align#align(bang, expr) range let [mode, n, ch] = s:interactive(copy(modes)) else let [n, ch, option, regexp] = s:parse_args(a:expr) - if empty(ch) + if empty(n) && empty(ch) + let [mode, n, ch] = s:interactive(copy(modes)) + elseif empty(ch) " Try swapping n and ch let [n, ch] = ['', n] endif diff --git a/doc/easy_align.txt b/doc/easy_align.txt index 2928432..822fea4 100644 --- a/doc/easy_align.txt +++ b/doc/easy_align.txt @@ -18,7 +18,7 @@ vim-easy-align defines `:EasyAlign` command in the visual mode. | Mode | Command | | ------------------------- | ---------------------------------------------- | -| Interactive mode | :EasyAlign[!] | +| Interactive mode | :EasyAlign[!] [OPTIONS] | | Using predefined rules | :EasyAlign[!] [FIELD#] DELIMITER_KEY [OPTIONS] | | Using regular expressions | :EasyAlign[!] [FIELD#] /REGEXP/ [OPTIONS] |