[texhax] What program can I use to edit TeX files?

Thomas Schneider schneidt at mail.nih.gov
Sun Mar 24 18:16:08 CET 2013

On Sun, Mar 24, 2013 at 01:18:26PM +0100, Uwe Lück wrote:
> Am Sonntag, den 24.03.2013, 11:00 +0000 schrieb Philip TAYLOR:
> > 
> > Thomas Schneider wrote:
> > 
> > > Vim, emacs or other straight text editors will do it.  Word or other
> > > word processors take a long time to start and are awkward to
> > > manipulate in comparison.  
> > 
> > . . .
> > 
> > > So while I'm editing the
> > > source latex .tex file in vim, I type a single ',' and my scripts
> > > automatically typeset and Skim redisplays without me taking my hands
> > > off the keyboard.
> > 
> > I cannot imagine anything that Word could possibly do that is
> > more awkward than interpretting a comma as a command to typeset
> > a file.  Do you have to prefix every ordinary comma with some
> > meta-command to prevent typesetting taking place ?
> > 
> > Word may not be the world's finest TeX editor, but at least
> > it does not usurp the meaning of one of the most common
> > characters used in texts.
> Vim has a command mode where single characters are "commands". 
> You insert a real comma after going into "editing" mode.
> You should not think that the many Vim fans are idiots 
> who just never have tried Word. Rather, many have tried 
> Word, but really find that working with Vim is much easier; 
> although not easy to learn.

Uwe's right.  One enters the insert mode with a variety of commands
(such as iIoOaA - they come in logical pairs!) and leaves it with an
escape character.  One pops rapidly between the two.  There is never
any confusion about a normal ',' in the text.

In my vim control file (~/.vimrc) I added these lines:

map , :w^M
map ; :wq^M
map ' :q^M

a comma     writes the file out without leaving vim.
a semicolon writes the file out and       quits vim.
a     colon                               quits vim.

They are logical (!luck!) and convenient for common actions.  Vim is
fast and efficient, these make it more so.  I type these while in
command mode of course.  (Note: these might be overriding some of
vim's normal commands - I never checked ...)

[NOTE: the symbols '^M' mean an actual control M so you would have to
replace each with a control M to get these to work.  That's easy in

Actually, vim isn't really that hard to learn.  One can get the basics
in a day - see my page http://alum.mit.edu/www/toms/vim.html -
especially the one page 'cheat sheet'.  If one starts a new word
processor one has to figure out where things are kept in the pulldown
menus.  If you haven't tried OpenOffice or LibreOffice you can try
them and you will see what I mean (and they are open source and free
so you don't have to pay anything!).  For every word processor command
one is FORCED to use the mouse to nit pickingly find the right
command.  You have to learn the locations of the commands.  In Vim one
simply types the command - no mousing at all since the command's
controls are effectively in one's head instead of a pull-down menu. 
Learn the command, it's always at your finger tips.  The point is that
there is a learning curve for any editing program.  The difference is
that Vim is efficient because it cuts out hunting with a mouse.

People who do very complex things like emacs and that's fine, but if
you want to edit with speed and precision and don't need a full blown
Turing machine, vim will serve you better.

Also, vim is open source and so should always be available. 
Commercial programs usually die eventually.


  Thomas D. Schneider, Ph.D.
  Senior Investigator
  National Institutes of Health
  National Cancer Institute
  Center for Cancer Research
  Gene Regulation and Chromosome Biology Laboratory
  Molecular Information Theory Group
  Frederick, Maryland  21702-1201
  schneidt at mail.nih.gov

More information about the texhax mailing list