I'm trying to set the path to sublime text editor for mongodb in the .mongorc.js on windows 8 so I add this line to .mongorc.js ...
EDITOR = "C:\\Program Files\\Sublime Text 3\sublime_text.exe";
which when I start mongo.exe from the command prompt and then type:
> edit blah
it returns:
'C\Program' is not recognized as an internal or external command
so I try
EDITOR = "C:\\Program\u0020Files\\Sublime\u0020Text\u00203\\sublime_text.exe";
and even
EDITOR = "C:\\Program%20Files\\Sublime%20Text%203\\sublime_text.exe";
and I get
The system cannot find the path specified.
You can have spaces in your editor name, you just have to be sure to escape everything properly. I don't have the editor you have installed, so I used wordpad.
> EDITOR="\"C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe\""
"C:\Program Files\Windows NT\Accessories\wordpad.exe"
> edit a
works for me. You need to enclose the whole thing in quotes, and then backslash escape backslashes and double quotes around the entire executable.
You can also make sure the path to your editor is in your default/system path, then you only need to assign the editor executable name to EDITOR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With