How to change WinGHCi editor with: set editor?

I want to use Notepad ++ instead of Notepad, as the GHCi editor calls when I type :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 features work.

Thanks for the help!

+8
haskell ghci
source share
4 answers

The editor is String , so you need to exit \ as \\ , for example:

 :set editor "C:\\Program Files (x86)\\Notepad++" 

but it is unix / windows agnostic for FilePaths, so you can alternatively do it like

 :set editor "C:/Program Files (x86)/Notepad++" 

As a note, faster :e enter :e instead of :edit ; ghci will output what you mean by a substring, for example :ed , if there is only one possibility.

+11
source share

Just stumbled upon this. The top answer is correct, but I could get this working by adding -multiInst to the ie command line:

 :set editor "C:/Program Files (x86)/Notepad++/notepad++.exe" -multiInst 

or simply

 "C:/Program Files (x86)/Notepad++/notepad++.exe" -multiInst 

in the WinGHCi settings dialog box, which opens a new instance of notepad ++ at: e.

+3
source share

I would suggest that Notepad ++ should be on your $ PATH. If you can run Notepad ++ from a recently opened terminal, then you are kind. Then use :set editor Notepad++ in ghci.

+2
source share

You can add a new system environment variable called EDITOR to the system environment variables if you want to constantly use the editor that you like.

Attentions:

  1. You must add it to the system environment variables, and not to the user environment variables.
  2. EDITOR must be written in capital letters.
  3. Most importantly, the value of this variable should be:
    • a Use double backslash.
    • b save quotes! (for example: "C: \ Users \\ AppData \ Local \ Programs \ Microsoft VS Code", I think that other variables may or may not need these quotes, but in this case they are NEEDED.)
0
source share

All Articles