## How to use external editor like vim with VREP?

Typically: "How do I... ", "How can I... " questions
pr0t0z
Posts: 24
Joined: 21 Nov 2014, 17:29

### Re: How to use external editor like vim with VREP?

Hello,

I adjusted the variable as you told me to.
When I try to open the script with notepad++ editor, I get the following warning.

With VSCode the same behavior happens as last time.

It now tries to look for the script file to open in the defaultDirectoryForExternalScriptEditor directory.
Shouldn't this directory be related to the scene or some tmp folder?

Cheers,

coppelia
Posts: 7396
Joined: 14 Dec 2012, 00:25

### Re: How to use external editor like vim with VREP?

It appears like V-REP cannot write the specified file. What happens if you start V-REP in admin mode?. Not sure what is going on on your machine, but I cannot reproduce that problem.

An alternative would be to include external files via the require command:

Code: Select all

require 'myExternalFile'
for a file named myExternalFile.lua. Then use your external editor to edit that file. The drawback is however that your scripts are not saved in the same file as your scene/model anymore (which can also be an advantage in some situations).

Cheers

pr0t0z
Posts: 24
Joined: 21 Nov 2014, 17:29

### Re: How to use external editor like vim with VREP?

Hello,

I tried running the program in admin mode, but it produces the same result.

I am running the:
V-REP PRO, Version 3.6.2 (rev. 0) 64bit (serialization version 22)
(Qt Version 5.12.1, MSVC2017),

on a Windows 10 Pro OS.

The second solution is not ideal to me. Guess I'll stick with the default editor for the moment.

coppelia
Posts: 7396
Joined: 14 Dec 2012, 00:25

### Re: How to use external editor like vim with VREP?

So it seems V-REP can't create those files. Can you check that there are no embScript_* files created in V-REP's folder, or if you set a value for defaultDirectoryForExternalScriptEditor, that no files are created there?
When specifying the defaultDirectoryForExternalScriptEditor make sure to not use the quotes around the string. e.g.:

defaultDirectoryForExternalScriptEditor=d:/myScriptTempFiles and not defaultDirectoryForExternalScriptEditor="d:/myScriptTempFiles"

Cheers

pr0t0z
Posts: 24
Joined: 21 Nov 2014, 17:29

### Re: How to use external editor like vim with VREP?

Okay...

I figured what was the problem.
The embScript_* files were being created in a non-existing folder.
The problem was that Win10 automatically sets my home folder name with a space.
Thus, if I do not add " ", it sets the defaultDirectoryForExternalScriptEditor to the subdirectory "C:\Program Files\V-REP3\V-REP_PRO"+the path substring after the space.

For the record, and as you said, one needs to set the defaultDirectoryForExternalScriptEditor to a path without spaces and without using " ".

Best regards,
CarlosFaria

coppelia