Ⅰ. 插件描述
Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'andersoncustodio/enter-indent'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'andersoncustodio/enter-indent'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'andersoncustodio/enter-indent'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/andersoncustodio/vim-enter-indent
Ⅳ. 文档说明
Este plugin facilita a realocação e indentação de tags de única linha para um bloco de código, por exemplo.
<?php | ?>
O traço vertical representa o cursor, com este plugin em funcionamento, ao apetar o enter o resultado será o seguinte.
<?php
|
?>
Também é compatível com tags html, BBcode, smarty e algumas outras.
<tr>
|
</tr>
{if}
|
{/if}
body {
|
}
Agora é possível desativar o mapeamento padrão para criar um personalizado
let g:enter_indent_default_keymap = 0
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-r>=EnterIndent()\<cr>"
Para um melhor aproveito do enter-indent
recomendo que você use os seguintes plugins.
- http://github.com/Raimondi/delimitMate - Fecha automaticamente aspas, parentese, colchete e etc
- http://github.com/tpope/vim-ragtag - Atalho para criar tags como
<?php ?>
- https://github.com/SirVer/ultisnips - Transforma palavras chaves com
TAB
em um trecho de código