Skip to content

Instantly share code, notes, and snippets.

@makestory
Created June 22, 2011 07:40
Show Gist options
  • Save makestory/1039648 to your computer and use it in GitHub Desktop.
Save makestory/1039648 to your computer and use it in GitHub Desktop.
vim function for create xml/html tag.
# useage:
#copy code to your .vimrc
#when you edit text in line > I`m a title
#command :H h1
#<h1>I`m a title</h1>
function! HtmlTag(tag)
normal $
execute "normal! a</".a:tag.'>'
normal ^
execute "normal! i<".a:tag.'>'
normal l
endfunction
com! -nargs=1 H :call HtmlTag(<f-args>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment