使用Bundle vundle安装:
Bundle 'junegunn/vim-easy-align
添加映射:
" Start interactive EasyAlign in visual mode (e.g. vipga) xmap ga <Plug>(EasyAlign) " Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
下面是官网的一个例子
apple =red
grass+=green
sky-= blue
尝试下面的命令:
vipga=
visual-select inner paragraph
Start EasyAlign command (ga)
Align around =
gaip= Start EasyAlign command (ga) for inner paragraph Align around =