Skip to content

Instantly share code, notes, and snippets.

@reinh
Created April 22, 2010 21:41
Show Gist options
  • Save reinh/375857 to your computer and use it in GitHub Desktop.
Save reinh/375857 to your computer and use it in GitHub Desktop.
autocmd FileType markdown map <Leader>h1 :.g/.\+/copy. <Bar> s/./=/g <CR>
autocmd FileType markdown map <Leader>h2 :.g/.\+/copy. <Bar> s/./-/g <CR>
@reinh
Copy link
Author

reinh commented Apr 22, 2010

h1 and h2 make lines headers

@tdreyno
Copy link

tdreyno commented Apr 22, 2010

And this is easier than the following or just more explicit?

is an h1

is an h2

is an h3

@tdreyno
Copy link

tdreyno commented Apr 22, 2010

doh! github markdowned my markdown.

(#) = h1
(##) = h2
(###) = h3

@reinh
Copy link
Author

reinh commented Apr 22, 2010

the ---- and ==== style are similar to asciidoc and signify a header more visually than #s. YMMV.
-R

PS, this could also be done via the cunning use of vim's repeat(), but this is more leet.
PPS, you can use markdown to make markdown not markdown your markdown:

# h1
## h2
### h3

@reinh
Copy link
Author

reinh commented Apr 22, 2010

PPPS, yo dawg, I heard you like markdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment