GPS is integrated with a number of external editors, in
particular Emacs
and vi
. The choice of the default
external editor is done in the preferences. See The Preferences Dialog.
The following values are recognized:
gnuclient
By default, gnuclient will open a new Emacs frame for every file that is opened. You might want to add the following code to your .emacs file (create one if needed) so that the same Emacs frame is reused every time:
(setq gnuserv-frame (car (frame-list)))
See http://www.hpl.hp.com/personal/ange/gnuserv/home.html for more
information.
emacsclient
emacs
emacsclient
instead, since it is much
faster, and makes it easier to copy and paste between multiple
files. Basically, the only reason to use this external editor is if
your system doesn't support emacsclient
.
vim
Vim
is a vi-like editor that provides a number of enhancements,
for instance syntax highlighting for all the languages supported by
GPS. Selecting this external editor will start an xterm (or command
window, depending on your system) with a running vim
process editing
the file.
Note that one limitation of this editor is that if GPS needs to open the same file a second time, it will open a new editor, instead of reusing the existing one.
To enable this capability, the xterm executable must be found in the PATH,
and thus is not supported on Windows systems. Under Windows systems,
you can use the custom
editor instead.
vi
vi
command instead of vim
.
custom
none
In the cases that require an Emacs server, GPS will try several solutions if no already running server was found. It will first try to spawn the glide environment distributed with GNAT. If not found in the PATH, it will then start a standard Emacs. The project file currently used in GPS will be set appropriately the first time Emacs is spawned. This means that if you load a new project in GPS, or modify the paths of the current project, you should kill any running Emacs, so that a new one is spawned by GPS with the appropriate project.
Alternatively, you can reload explicitly the project from
Emacs itself by using the menu Project->Load
In the preferences, there are three settings that allow you to select the external editor (if left to an empty string, GPS will automatically select the first editor available on your system), to specify the custom editor command, in case you've selector this item, and whether this editor should always be used every time you double-click on a file, or whether you need to explicitly select the contextual menu to open the external editor.