Reputation: 404
I want to use Notepad++ instead of Notepad as the editor GHCi calls when I type in :edit
. Does anyone know how to do this? I tried
:set editor C:\Program Files (x86)\Notepad++
:set editor "C:\Program Files (x86)\Notepad++"
but none of these work.
Thanks for the help!
Upvotes: 10
Views: 5949
Reputation: 31
You can add a new system environment variable called EDITOR to your system environment variables if you want to use the editor you like permenantly.
Attentions:
Upvotes: 0
Reputation: 31
Just came across this one. The top answer is correct however I could only get this working by adding -multiInst to the command line i.e:
:set editor "C:/Program Files (x86)/Notepad++/notepad++.exe" -multiInst
or just
"C:/Program Files (x86)/Notepad++/notepad++.exe" -multiInst
in the settings dialog of WinGHCi which opens a new notepad++ instance on :e.
Upvotes: 3
Reputation: 32455
The editor is a String
, so you need to escape \
as \\
, like so:
:set editor "C:\\Program Files (x86)\\Notepad++"
but it's unix/windows agnostic for FilePaths, so you could alternatively do it as
:set editor "C:/Program Files (x86)/Notepad++"
As a side note, it's quicker to type :e
instead of :edit
; ghci will deduce what you mean from a substring like :ed
if there's only one possibility.
Upvotes: 12
Reputation: 3050
I would guess that Notepad++ should be on your $PATH. If you can run Notepad++ from a newly-opened terminal, then you're good. Then use :set editor Notepad++
in ghci.
Upvotes: 2