作者curist (SERIOUSLY!!!???)
看板Editor
标题Re: [vim ] 有自动完成html close tag的vim plugin吗
时间Mon Feb 4 21:08:55 2013
iabbr
:iabbrev </ </<C-X><C-O>
imap
:imap <C-Space> <C-X><C-O>
自动关tag plugin
xmledit:
http://www.vim.org/scripts/script.php?script_id=301
AutoCloseTag:
http://www.vim.org/scripts/script.php?script_id=2591
手动关tag plugin
closetag.vim:
http://www.vim.org/scripts/script.php?script_id=13
ragtag.vim:
http://www.vim.org/scripts/script.php?script_id=1896
个人这几个plugin都用过,但不太习惯...
现在是用从sublime text偷来的
autocmd FileType html inoremap
<expr> / (getline('.')[col('.')-2]=="<")?"/\<Lt>C-X>\<Lt>C-O>":"/"
效果同第一个iabbr </ </<C-X><C-O>,但不会在输入<时卡在那边
参考:
http://vim.wikia.com/wiki/Auto_closing_an_HTML_tag
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.160.19.147
1F:推 Arim:感谢︿︿ 02/05 10:24