diff --git a/README.md b/README.md index e4dad5c..52a9d2c 100644 --- a/README.md +++ b/README.md @@ -619,6 +619,26 @@ let g:easy_align_delimiters = { \ } ``` +### EasyAlign as Vim operator + +You can define an operator function which calls EasyAlign command, so that it +can be used with a Vim movement. + +```vim +function! s:easy_align_1st_eq(type, ...) + '[,']EasyAlign= +endfunction +nnoremap = :set opfunc=easy_align_1st_eqg@ + +function! s:easy_align_1st_colon(type, ...) + '[,']EasyAlign: +endfunction +nnoremap : :set opfunc=easy_align_1st_colong@ +``` + +Now without going into Visual mode, you can align text in the paragraph +by `=ip` or `:ip`. + Advanced examples and use cases -------------------------------