Help

Working Environement

Text Editor

Text editor is the developper tool. As any tool, you must know how to use it deeply. This means I strongly advice you to take times (at least one hour!) only on your text editor. It’s clearly not a loss of time: you will be more productive and efficient later.

There exists multiple open-source text editors such as the old-but-gold Emacs and VI/VIM or more modern software as VSCode.

If you do not know which one to chose and even though Emacs and VIM are extremely powerful, I strongly suggest you to pick up VSCode because of its fast learning curve and the numerous extension packages. In short, you can have a powerful and efficient working environment in less than an hour.

Syntax highlighting

GMSH has its own parser and language, even though using the API is generally a better option (see below). If you want to work with .geo files (GMSH files), you might be interest in automatic indent and syntax highlighting:

  • VSCode through the GMSH extension.
  • Emacs via [this little file]( Emacs. Note that this has not been updated for a while.
  • $\LaTeX$ using the latex_gmsh package. This home made package provides some commands as \gmsh{blabla} to display GMSH code in a nice way (using lstlisting).

A closer look into VSCode

Extensions

I suggest you to install the following extensions, available on the market or directly in VSCode windows:

The first two are clearly useful for these tutorial and will provide numerous facilities. For example, working with the GMSH language (.geo file) would give you syntax coloration and automatic indent

VSCode syntax coloration for GMSH

While working in Python with the API will provides you coloration, indent, suggestion and even help!

VSCode syntax coloration for GMSH

Terminal inside VSCode

Such as Emacs or VIM, a terminal can be opened inside VSCode by clicking on Terminal and New Terminal. This is very useful as you don’t have to switch between text editor and the shell.

Documentation

  1. Official documentation, also available as a pdf file
  2. GMSH’s Gitlab: for any issue or question
  3. Mailing list (will probably be deprecated)
  4. Numerous examples can be found in the source code of GMSH or even in the Onelab Models. For the API, examples are provided