Skip to content

Instantly share code, notes, and snippets.

@swaroopch
Created August 3, 2010 14:15
Show Gist options
  • Save swaroopch/506442 to your computer and use it in GitHub Desktop.
Save swaroopch/506442 to your computer and use it in GitHub Desktop.
Making it easy to create headings in ReStructuredText syntax, in Vim
if has('ruby')
function! Heading(char)
ruby <<EOF
buffer = VIM::Buffer.current
new_line = VIM::evaluate("a:char") * buffer.line.length
buffer.append(buffer.line_number, new_line)
EOF
endfunction
command H1 call Heading('=')
command H2 call Heading('-')
command H3 call Heading('~')
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment