" for jekyll *.md
auto BufNewFile,BufRead *.md set encoding=utf-8
auto BufNewFile,BufRead *.md set filetype=makrdown
" auto BufNewFile [0-9]\\\{4\}-[0-9]\\\{2\}-[0-9]\\\{2\}-*.md exec ":call JekyllMDHeader()"
auto BufNewFile [0-9]\\\{4\}{-[0-9]\\\{2\}}\\\{2\}-*.md exec ":call JekyllMDHeader()"
function JekyllMDHeader()
let typelen = 6
let cwd = getcwd()
let posttype = strpart(cwd, strlen(cwd)-typelen, typelen)
let category = "category: " . posttype
" if posttype == "读书"
"
" elseif posttype == "技术"
"
" elseif posttype == "碎言"
"
" elseif postype == "私库"
"
" elseif postype == "资源"
"
" else
"
" endif
call setline(1, "---")
call append(1, "title: ")
call append(2, "layout: post")
call append(3, "author: onephone")
call append(4, category)
call append(5, "tags: []")
call append(6, "---")
endfunction
SWF's Hacking Dream 由 onephone 创作,采用 知识共享 署名-非商业性使用 4.0 国际 许可协议进行许可。
© 2011-2024. All rights reserved by onephone. Powerd by Jekyll.