PDA

View Full Version : Changing editor in GHC interactive mode



meson2439
January 8th, 2009, 03:27 PM
I'm a beginner in Haskell programming and this is my first functional programming experience. Using the interactive mode in ghc I would like to know how to edit my .hs files using a preferred editor (nano in this case). I tried to do this


Prelude> :!nano
Received SIGHUP or SIGTERM
Prelude> :set editor "nano %s"
Prelude> :edit jhah.hs
/bin/sh: nano %s: not found
Prelude> :set editor="nano %s"
unrecognised flags: editor=nano %s
Prelude> :set editor="/bin/nano %s"
unrecognised flags: editor=/bin/nano %s
Prelude> :set editor="/bin/nano+%s"
unrecognised flags: editor=/bin/nano+%s
Prelude> :set editor="nano"
unrecognised flags: editor=nano
Prelude> :set editor "nano"
Prelude> :edit ads.hs
Received SIGHUP or SIGTERM

Can someone tell me what I'm doing wrong. I also won't mind using emacs but I'm not yet acquainted with vi or vim. Thanks.

Reiger
January 8th, 2009, 03:57 PM
Hmm odd. Anyway the :set editor command works fine with vim, kate and gedit...

meson2439
January 8th, 2009, 04:33 PM
Thanks. I also found out that setting the editor to emacs also work. I also found that setting the editor to nano also fails in Octave. Does anybody knows why?

jpkotta
January 9th, 2009, 07:22 AM
nano is clearly doing something weird. It seems to work if you start a terminal running nano.

:!xterm -e nano

jpkotta
January 9th, 2009, 07:29 AM
In octave, set the mode to async (-nw emacs doesn't work without that either). This is basically like appending a '&' to the editor command.


edit mode async