Code Monkey home page Code Monkey logo

auctex.vim's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=162

This is a large collection of Latex macros, with inspiration
from the emacs package "auctex", among other places.  
Read the file for details;  I have written many comments.

You should freely modify these macros.  Most of them are  
indepent, so nothing will break.  In some places I've provided
alternate versions which are commented out.  If you have good 
ideas, contact me and I'll incorporate them.

By popular demand, here is a more extensive description of
the key bindings:
http://www.math.rochester.edu/people/faculty/cmlr/Latex/auctex-vim-keybindings

There is also Vim-LaTeX,
http://vim-latex.sourceforge.net 
It is a more extensive package, developed by a group, and I have 
contributed most of my ideas to this project.  You might prefer 
my script if you like something smaller, with parts that are (mostly) 
independent and easy to modify.

Briefly,

In normal mode, F1 - F4 will insert latex templates, unless they are
already there in the file.  You have to provide these templates yourself.

In insert mode, F1 - F5 will insert environments such as \begin{..} \end{..}.

C-S-F1 through C-S-F5 will alter existing environments.

(), $$, [], \[\], {}, \{\}, && are inserted in matching pairs.

Outside of a math environment, tab does word completion, 
or gives a tab if the previous character is a space or 
a line beginning.  Within a math environment, 
tab moves you between parentheses or to the end of the 
environment.

Many Latex commands are bound to the ` key.  (This comes from auctex).
For instance, \alpha is bound to `a, and \infty is bound to `8.
\frac{}{} is bound to `/  .

Menu items allow you to change or delete matching pairs of brackets,
as well as insert \left..\right automatically.  

Now pressing <Insert> twice will also allow modification of brackets, according 
to a menu that appears at the bottom.

In normal mode, K runs latex, takes you to the position of the first error (if any),
and displays the error message with highlighting.

To get \mathbf{R}, type r<Insert>b.  To get \mathcal{R}, type r<Insert>c. 
<Insert>s produces \sqrt{}.  Capital letters are more common, but you can
still get \mathbf{x} by typing X<Insert>b.  Same for \mathcal.

Some macros are polymorphic.  For instance, when preceded by bracket, 
<Insert>l will insert \left..\right around the brackets.  Otherwise it 
will insert \label{} and position the cursor in between the {}.
Likewise, <Insert>c will produce \cite{} when preceded by a blank or at 
the beginning of the line;  but, for example, b<Insert>b will produce \mathbf{B}.

There are "smart quotes".  That is, typing " will produce a `` if there is
a space before the ", and will produce '' otherwise.

You can embrace the visual region with () by typing `(.  This works 
for other kinds of parentheses, too, as well as $$ and &&.

Long lines are automatically split up to keep $..$ (math expressions)
on the same line.

There are several abbreviations, such as \b for \bigskip.

You can add your own macros, the macro key is ;

Inspired by LaTeX-Suite, the tab key has some new uses.  Inside \ref{}, it opens 
a subwindow with the reference keys.  Pressing enter will insert that reference.  
Ditto for \cite{}, the subwindow will show either your bibitem entries (if any) or 
your bibtex file.  Pressing enter within the bibtex reference will insert the proper 
citation key.

auctex.vim's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.