2013-08-16

Why Vim?

Searching something like "vim best editor", "vim vs IDE" Google, you can find too many results, and it's impossible to finish reading all those articles. Therefore, I selected some and post the link here.

Programmers

The video below is a talk given by Bram Moolenaar, creator of Vim. The handout for this talk is found on his website. However, he assumed that the audience had some basic knowledge on movements in Vim. For Chinese users, the slides below may help you. Otherwise, please go down to here

  1. Quick jumping of text: e.g. 5w,2(
  2. Text objects: e.g. da<,ci"(,dci{(
  3. Vim-Macro: e.g. 5w,2(
  4. Folds: seeing structures and moving quickly

Writers

With many keyboard shortcuts, Vim enables you to move quickly between words, sentences and paragraphs, and thus focus on writing.
See Randall Wood's Vim for Writers blog entry as well as his notes.

Vim Advocacy

  1. Why, oh WHY, do those #?@! nutheads use vi?
  2. Vi Lovers

Vim Game

  1. VIM Adventures

Vim E-Book

  1. Vi IMproved—Vim by Steve Oualline

APA Citing

Typing in the APA reference list entries are tedious. Therefore, use the biblatex-apa package.

For the sample files, please click the above "Youtube" button.

Why biblatex instead of $\text{Bib} \rm \TeX$?
Apart from the support of @online tag, see this blog post on the comparison between the apacite and biblatex-apa packages.

For writing scientific reports, refer to $\rm \LaTeX$ Style and Bib$\rm \TeX$ Bibliography Formats for Biologists: $\rm \TeX$ and $\rm \LaTeX$ Resources

Edit $\rm \LaTeX{}$ equations on Vim

With the Vim-$\rm \LaTeX$ plugin, it's possible to edit $\rm \LaTeX$ equations with Vim quickly without making syntax errors. (e.g. undefined control sequence caused by mismatched braces '{}')

For the sample files, please click the above "Youtube" button.

Why use Vim? Please refer to my post on Vim.

For a quick startup guide, see the official tutorial. If you've learnt those keyboard mappings, here's a quick review of some commands. For detailed list of all keyboard shortcuts and customizations (e.g. custom compile rule: use pdflatex instead of latex and dvipdfm), you can refer to the user manual.

There're many blog entries about how to install $\rm \LaTeX$ on Vim/GVim on UNIX/Linux and M$. Searching "vim latex" gives you millions of search results. Summarizing the articles, the three major components are:

  1. Editor
    • Vim (found on almost every distribution of *nix)
    • GVim (on GUI of any platform)
  2. $\rm \LaTeX$
    • $\rm \TeX \text{Live}$ (found in package manager on *nix)
    • $\text{Mik}\rm \TeX$ (have a $\rm \LaTeX$ package manager)
  3. Vim plugin for writing $\rm \LaTeX$: Latex-Suite

For *nix, you may find some GUI tools for installing packages. (especially in some popular distributions)


Software Centre in Ubuntu 12.04 LTS


PackageKit in Fedora 17

You can also type the install commands for these packages on the terminal. For example:
  1. Ubuntu
    # Also include `vim-gnome' if you'd like to install GVim.
    $ sudo apt get install vim-gnome vim-latexsuite texlive
    
  2. Fedora
    # Also include `vim-X11' if you'd like to install GVim.
    [root@localhost]# yum install vim-latex latex
    
Unlike M$, the dependencies will be automatically resolved.

For M$, the installation procedures for GVim (portable), Vim-$\rm \LaTeX$ and $\text{Mik}\rm \TeX$ (portable) are as followed:

  1. Go to the official websites of GVim and $\text{Mik}\rm \TeX$ (or equivalent packages) and download the packages.
  2. Put $\text{Mik}\rm \TeX$ portable and GVim portable to any folder you like
    • e.g. C:\Temp
    • DON'T put them under C:\Program Files
  3. Download Vim-$\rm \LaTeX$ from SourceForge
  4. Follow the steps here
Remarks: The installation of Vim-$\rm \LaTeX$ (items 3 and 4) is the same for portable and non-portable versions of GVim.

Testing MathJax

Following the instructions here, MathJax works on Blogpost.
I typed
$\cos^2\theta-\sin^2\theta=\cos 2\theta$
and here's the result: \(\cos^2\theta-\sin^2\theta=\cos 2\theta\)
Antoher equation: \[ ax+\frac{b}{y}=1 \] This time, the equation is in display mode.
How about the inline verbatim environment? Googling "mathjax verbatim", we have \[\verb*$x^2\sqrt y$* \text{ yields } x^2\sqrt y\] on $\rm \TeX \text{ Commands available in MathJax}$ . Nevertheless, it only works in display mode.
Finally, let's get some equations numbered, just like an example on MathJax. \begin{equation} \int_{0}^{\frac{\pi}{2}} \sin x \, \mathrm d x = 1 \end{equation}