简体   繁体   中英

Faster way to use latex with vi

I use VI to write my homework in latex, but I was wondering if there is a way to "store" commands in VI. I mean, instead of write every time I need:

\begin{equation}
\end{equation}

can I use a command or something like this to do it faster?

I bet you will love the plugin snipMate . You type eq<TAB>x^2-x-1=0 and it displays

\begin{equation}
  x^2-x-1=0
\end{equation}

He comes with a lot of snippets for multiple languages including Latex. Obviously you can add your own snippets.

Add this to .vimrc or a separate file that you source into vim:

map! @E \begin{equation}^V^M\end{equation}^[O

Here ^V means press control-V twice , ^M means control-V, control-M, ^[ , means control-V, esc.

Then, when in input mode, type @E to expand.

Write as many abbreviations like that as you wish of course.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM