diff options
-rw-r--r-- | .vim/skel/bash | 3 | ||||
-rw-r--r-- | .vim/skel/tex | 17 | ||||
-rw-r--r-- | .vim/skel/zsh | 3 | ||||
-rw-r--r-- | .vimrc | 24 |
4 files changed, 46 insertions, 1 deletions
diff --git a/.vim/skel/bash b/.vim/skel/bash new file mode 100644 index 0000000..b6d0a1b --- /dev/null +++ b/.vim/skel/bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +%START% diff --git a/.vim/skel/tex b/.vim/skel/tex new file mode 100644 index 0000000..3fb79fb --- /dev/null +++ b/.vim/skel/tex @@ -0,0 +1,17 @@ +\documentclass[letter,12pt]{article} +\usepackage[margin=1in]{geometry} + +\usepackage{xeCJK} +\setCJKmainfont[Scale=.8]{IPAMincho} + +\title{} +\author{} + +\begin{document} + +\frenchspacing +\maketitle + +%START% + +\end{document} diff --git a/.vim/skel/zsh b/.vim/skel/zsh new file mode 100644 index 0000000..ebcd4c1 --- /dev/null +++ b/.vim/skel/zsh @@ -0,0 +1,3 @@ +#!/usr/bin/env zsh + +%START% @@ -9,7 +9,7 @@ endif set nocompatible filetype off -set rtp+=~/.vim/bundle/Vundle.vim +execute 'set rtp+=' . split(&rtp, ',')[0] . '/bundle/Vundle.vim' call vundle#begin() Plugin 'gmarik/Vundle.vim' @@ -252,6 +252,28 @@ autocmd FileType text call Settings_text() autocmd FileType vim call Settings_vim() autocmd FileType zsh call Settings_shell() +"command for reading filetype skeletons +function! Settings_skel_read() + if line('$') != 1 || col('$') != 1 + " echoh ErrorMsg + " echo "err: cannot load skeleton: buffer is not empty" + " echoh None + return 1 + end + if filereadable(split(&rtp, ',')[0] . "/skel/" . &ft) == 0 + " echoh ErrorMsg + " echo "err: cannot load skeleton: no skeleton found for filetype '" . &ft . "'" + " echoh None + return 1 + end + let l:fname = split(&rtp, ',')[0] . "/skel/" . &ft + execute 'r ' . l:fname + execute "normal ggJ/%START%\<CR>cc" + redraw! +endfunction +autocmd FileType * call Settings_skel_read() + +""write mode" for markup-type formats function! Settings_sub_wmodetoggle() if &fo =~ 'a' setlocal formatoptions-=a |