commit 8f1372f80031ec9c9933116c2fbf0cc821abcbf2 parent 9cc806f5a0ce9a7c616813cd01bdc4434384481c Author: Xiaodong Xu <[email protected]> Date: Wed May 4 22:16:28 +0800 Update custom config Diffstat:
_vim/conf/abbrevs.vim | | | 7 | +++++-- |
_vim/conf/base.vim | | | 7 | +++++-- |
_vim/conf/funcs.vim | | | 16 | +++++++++++++++- |
diff --git a/_vim/conf/abbrevs.vim b/_vim/conf/abbrevs.vim @@ -1,6 +1,6 @@ " " author : Xu Xiaodong <[email protected]> -" modified : 2013 Oct 22 +" modified : 2016 Apr 26 " "-- abbrevs --" @@ -10,7 +10,7 @@ iab _mo <c-r>="modified : " . strftime("%Y %b %d")<cr> iab _na Xu Xiaodong iab _ma [email protected] -iab _da <c-r>=strftime("%Y %b %d")<cr> +iab _da <c-r>=strftime("%Y-%m-%d %T")<cr> iab _fn <c-r>=bufname("%")<cr> iab _pl #!/usr/bin/env perl @@ -24,3 +24,6 @@ iab _hlr {% highlight ruby %} iab _ehl {% endhighlight %} iab ,, => + +iab _ps <!-- PELICAN_END_SUMMARY --> +iab _pi [![]({filename}/images/)]({filename}/images/) diff --git a/_vim/conf/base.vim b/_vim/conf/base.vim @@ -1,6 +1,6 @@ " " author: Xu Xiaodong <[email protected]> -" modified: 2011 May 08 +" modified: 2015 May 21 " "-- base --" @@ -12,7 +12,10 @@ nmap <s-tab> ^i<bs><esc> vmap <s-tab> <gv " set modeline -nmap _m :call _set_modeline()<cr> +"nmap _m :call _set_modeline()<cr> + +" add markdown header +nmap _m :call MarkdownHeader()<cr> " auto update timestamps autocmd BufWritePre * call _last_modified() diff --git a/_vim/conf/funcs.vim b/_vim/conf/funcs.vim @@ -1,6 +1,6 @@ " " author : Xu Xiaodong <[email protected]> -" modified : 2012 Jun 30 +" modified : 2016 Apr 26 " "-- update timestamps --" @@ -98,3 +98,17 @@ function! _perl_comment() exe 's/^/#/g' endif endfunction + +"-- Markdown header --" + +function! MarkdownHeader() +let date = strftime("%Y-%m-%d %T") +exe "normal iTitle: " +exe "normal oDate: " . date +exe "normal oAuthors: toy" +exe "normal oCategory: News" +exe "normal oTags: " +exe "normal oSlug: " +exe "normal oVia: " +exe "normal o" +endfunction