Sgt. Pepper
Sgt. Pepper

Reputation: 61

Default working directory in SWI Prolog

I'm having a problem with changing a directory in which I store *.pl files. The default one is located in my home folder. I can change working directory, either by using working_directory predicate or cd command in swipl interpreter. The thing is I have to do it every single time I run SWI Prolog, so I'm looking for a permanent solution. I tried to include those two solutions in .plrc file, which I created in my home directory but it didn't help.

I am a Mac OS X user, if that would be of any help.

Also, can you recommend any text editors for Prolog with multi-tabs support?

Upvotes: 3

Views: 2004

Answers (1)

Paulo Moura
Paulo Moura

Reputation: 18683

SWI-Prolog supports a per-user initialization file which, on POSIX systems such as MacOS X, is named .plrc. Simply create this file (if it doesn't exist already) on your home directory and add to it the line:

:- initialization(cd).

Regarding text editors with multi-tab and syntax coloring support for Prolog, try e.g. TextMate 2 (with the Prolog or the Logtalk bundles installed).

Upvotes: 3

Related Questions