Emacs and Gams (and R and LaTeX and …)
GAMS users probably spend most of their time editing their models. Just before project deadlines they may sit more than 8 hours a day in front of their computer hacking through their code. The choice of a good editor can therefore be crucial. After years of trying different editors I finally stuck (xxx) with the open-source editor Emacs.
For those of you who want to stop reading because they heard about the disadvantages of Emacs (“It has a steep learning curve”, “It is more a program for hackers” or “You have to learn all kind of key bindings by heart”), I can only say, that most of the disadvantages of Emacs are true. But: using Emacs in combination with Gams-Mode (an extension of Emacs developed by Shiro Takeda) can make your programming life so much easier and you will increase your efficiency so much, that reading on might save you hours of editing time.
For those of you who need more reasons for switching to Emacs, here are some of the advantages (in upcoming posts I will talk about all of these advantages in more detail):
- The editing facilities of the GAMS IDE are nothing compared to Emacs.
- The Gams Mode in Emacs is heaven on earth for doing Gams coding
- If you write your reports with LaTeX Emacs is probably one of the best editors around .
- For those of you who work with R (statistics) or Stata: Emacs Speaks Statistics (ESS) lets you do your statistics from within Emacs.
- If you write your statistics reports with LaTeX, you can use Sweave allowing you to embed your R-Code in your LaTeX document and let Emacs generate reports while running your analysis, generating graphs and tables for your report at the same time.
- Emacs has many extensions for working with other programming languages (Python, Perl, PHP, etc.).
- Emacs allows you to integrate your versioning system. I use Subversion and can from within Emacs use all commands like commit, update, etc.
- Making quick notes is easy in Emacs: you can generate a note and Emacs adds automatically a hyperlink to the file you are working on. This is a great feature if you want to keep working on the main issues in your model, but don’t want to forget to do some minor tasks. Instead of writing those tasks on a peace of paper of making it a task in Outlook, you can keep on working in Emacs and the next day it is easy to jump back to the place where the task refers to.
- Emacs runs on Windows, Linux and Mac.
For me the most important reason was the possibility to use one and only one editor for completely different tasks (R, Gams, LaTex, Note taking, Pytyhon and PHP). Instead of having to learn several different editors like WinEdt, the editor of GAMS IDE, Tinn-R, Beans, OneNote, I now have one editor.