Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
cookiessOffline
15 Post subject: (solved) Glasgow Haskell Compiler  PostPosted: 06.10.2010, 17:02



Joined: 2010-09-12
Posts: 5

Status: Offline
Every time I start the ghci (Glasgow Haskell Compiler interpreter) to test some scripts and I have to edit them, the command ":edit test.hs" does not work. The message "editor not set, use :set editor" comes up. When i set the editor with ":set editor vim" it works fine. But when i close the ghci and start it again, the ":edit" command does not work.

I tried to set another default system editor with "update-alternatives --config editor" as root. The editor that is called with "/usr/bin/editor" is now the one I set, but in ghci the error "editor not set, use :set editor" keeps coming up.

Is there a way to tell ghci which editor should be used without using ":set editor" every time?

thanks
cookiess


Last edited by cookiess on 07.10.2010, 08:31; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
evnuOffline
Post subject: RE: Glasgow Haskell Compiler  PostPosted: 06.10.2010, 20:01



Joined: 2010-09-12
Posts: 5

Status: Offline
Works here like a charm.

From http://www.haskell.org/ghc/docs/6.10.4/ ... mands.html :
      Quote:

:edit [file]
Opens an editor to edit the file file, or the most recently loaded module if file is omitted. The editor to invoke is taken from the EDITOR environment variable, or a default editor on your system if EDITOR is not set. You can change the editor using :set editor.


Does update-alternatives change $TERM for you? Check it by using echo $TERM.
 
 View user's profile Send private message  
Reply with quote Back to top
cookiessOffline
15 Post subject:   PostPosted: 07.10.2010, 08:31



Joined: 2010-09-12
Posts: 5

Status: Offline
update-alternatives did not change the $TERM variable, but I vound out that echo $EDITOR returns nothing.
I added export EDITOR=vim in ~/.bashrc and now the editor is set. Now calling :edit test.hs works fine in ghci.

thank you evnu.

cookiess
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio