neocomplcache-snippets-completeをつかう
いつまでもzencoding.vimで無理やりスニペット入力するのはどうかと思ったのでneocomplcache-snippets-completeに移行しました。
tex.snipはこんな感じ。
snippet align
alias \begin{align}
\begin{align}
${1}
\end{align}
snippet aligns
alias \begin{aligns}
\begin{aligns}
${1}
\end{aligns}
snippet table
alias \begin{table}
\begin{table}[htbp]
\begin{center}
\caption{}
\label{}
\begin{tabular}{}
${1}
\end{tabular}
\end{center}
\end{table}
snippet figure
alias \begin{figure}
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.7\textwidth]{${1}}
\caption{}
\label{}
\end{center}
\end{figure}
snippet thebibliography
alias \begin{thebibliography}
\begin{thebibliography}{99}
\bibitem{${1}}
\end{thebibliography}
snippet eqnum
alias \renewcommand{\theequation}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\makeatletter
\@addtoreset{equation}{section}
\makeatother
snippet jsart
alias \documentclass{jsarticle}
\documentclass{jsarticle}
\usepackage{amsmath,amssymb}
\usepackage[dvipdfmx]{graphicx}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\makeatletter
\@addtoreset{equation}{section}
\makeatother
\title{${1}}
\author{}
\date{}
\begin{document}
\begin{abstract}
\maketitle
\section{}
\begin{thebibliography}{99}
\bibitem{}
\end{thebibliography}
\end{document}
snippet jart
alias \documentclass{jarticle}
\documentclass{jarticle}
\usepackage{amsmath,amssymb}
\usepackage[dvipdfmx]{graphicx}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\makeatletter
\@addtoreset{equation}{section}
\makeatother
\title{${1}}
\author{}
\date{}
\begin{document}
\begin{abstract}
\maketitle
\section{}
\begin{thebibliography}{99}
\bibitem{}
\end{thebibliography}
\end{document}とりあえずコードだけ入れておき、キャプションなんかは後で調整することが多いので、プレースホルダは少なくしています。
また、別途plugins.vimを作って.vimrcからsourceします。
if has('win32') + has('win64') let g:neocomplcache_snippets_dir = expand('$HOME/vimfiles/snippets') elseif has('unix') let g:neocomplcache_snippets_dir = expand('~/.vim/snippets') else let g:neocomplcache_snippets_dir = expand('~/.vim/snippets') endif imap <C-k> <Plug>(neocomplcache_snippets_expand) smap <C-k> <Plug>(neocomplcache_snippets_expand) noremap es :<C-u>NeoComplCacheEditSnippets<CR>
Windowsの $HOME/vimfiles とかLinuxの ~/.vim は ~/Dropbox/.vim のシンボリックリンクにしています。
plugins.vimの中ではNeoBundle関係の記述も入れて、必要なプラグインのロード・設定をまとめて書いています。今はpathogen.vimは使わなくなりました。
とはいえ、neocomplcacheとneocomplcache_snippets_completeとzencodingしか入ってないのですが。