From 68f6e1851affe575837c0ae08d7f63dd2503b748 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Sat, 1 Sep 2012 13:04:49 -0600 Subject: [PATCH] add option for customizing the empty tag suffix Example: To expand the br tag as
instead of the default
, put this in your .vimrc: let g:user_zen_settings = { \ 'html': { \ 'empty_element_suffix': '/>', \ }, \} --- autoload/zencoding.vim | 3 ++- autoload/zencoding/lang/html.vim | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index f51506e..cd0116f 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -1339,7 +1339,8 @@ let s:zen_settings = { \ }, \ 'empty_elements': 'area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command', \ 'block_elements': 'address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6', -\ 'inline_elements': 'a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var' +\ 'inline_elements': 'a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var', +\ 'empty_element_suffix': ' />' \ }, \ 'xsl': { \ 'extends': 'html', diff --git a/autoload/zencoding/lang/html.vim b/autoload/zencoding/lang/html.vim index 11545bb..6be5202 100644 --- a/autoload/zencoding/lang/html.vim +++ b/autoload/zencoding/lang/html.vim @@ -335,7 +335,7 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters, let str = "\n" . str endif if stridx(','.settings.html.empty_elements.',', ','.current_name.',') != -1 - let str .= " />" + let str .= settings.html.empty_element_suffix else let str .= ">" let text = current.value[1:-2]