Created
July 20, 2017 16:25
-
-
Save dhulihan/3f06cd639edb6a147d5a685fe658a132 to your computer and use it in GitHub Desktop.
Print markdown header in vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Author: Dave Hulihan | |
" Purpose: Prints cute markdown header at the top | |
" of the file, based on filename. | |
" Print filename header in markdown | |
function! MarkdownHeader() | |
let @a = "#" | |
put! a | |
put % | |
normal ggJ | |
s/\.md$// | |
normal jdd | |
endfunction | |
" map function | |
command! MarkdownHeader call MarkdownHeader() | |
" call this on new buffers ending in .md | |
autocmd BufNewFile *.md MarkdownHeader |
Author
dhulihan
commented
Jul 20, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment