diff options
-rw-r--r-- | .vim/skel/tex | 1 | ||||
-rw-r--r-- | .vimrc | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/.vim/skel/tex b/.vim/skel/tex index 3fb79fb..4b79470 100644 --- a/.vim/skel/tex +++ b/.vim/skel/tex @@ -6,6 +6,7 @@ \title{} \author{} +\date{%DATE%} \begin{document} @@ -284,14 +284,15 @@ function! Settings_skel_read() if filereadable(split(&rtp, ',')[0] . "/skel/" . &ft) == 0 return 1 end - execute 'r ' . split(&rtp, ',')[0] . "/skel/" . &ft - "move cursor to START - execute "normal ggJ/%START%\<CR>:%s/%START%//g\<CR>" - redraw! + execute 'silent! r ' . split(&rtp, ',')[0] . "/skel/" . &ft + "read the date into %DATE% + execute '%s/%DATE%/' . system("date '+%a, %B %d, %Y'|tr -d '\n'") . '/ge' + "move cursor to %START% + execute "silent! normal! ggJ/%START%\<CR>:s/%START%//\<CR>" endfunction autocmd FileType * call Settings_skel_read() -""write mode" for markup-type formats +""write mode" for prose-y formats function! Settings_sub_wmodetoggle() if &fo =~ 'a' setlocal formatoptions-=a |