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?

Post by pr0t0z » 28 Oct 2019, 13:13

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.
Image

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
Site Admin
Posts: 7396
Joined: 14 Dec 2012, 00:25

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

Post by coppelia » 29 Oct 2019, 13:32

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?

Post by pr0t0z » 04 Nov 2019, 14:28

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
Site Admin
Posts: 7396
Joined: 14 Dec 2012, 00:25

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

Post by coppelia » 05 Nov 2019, 13:23

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?

Post by pr0t0z » 07 Nov 2019, 11:38

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
Site Admin
Posts: 7396
Joined: 14 Dec 2012, 00:25

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

Post by coppelia » 08 Nov 2019, 15:55

Thanks for the confirmation!

Cheers

Post Reply