The long term goal of the project is to make Yi the editor of choice for Haskell hackers.

The long term goal of the project is to make Yi the editor of choice for Haskell hackers.

Line 28:

Line 28:

Yi depends on the [http://haskell.org/platform Haskell Platform] which must be installed. Many Haskellers haven't installed this explicitly, as they have already installed most of the utilities it contains; to be sure you have everything that is needed, it is recommended that you explicitly install the Platform.

Yi depends on the [http://haskell.org/platform Haskell Platform] which must be installed. Many Haskellers haven't installed this explicitly, as they have already installed most of the utilities it contains; to be sure you have everything that is needed, it is recommended that you explicitly install the Platform.

−

Following that, simply:

+

Following that, simply:

$ cabal update

$ cabal update

Line 61:

Line 61:

First, you should install the current version of [http://www.haskell.org/platform/windows.html Haskell Platform for Windows]. The version 2012.4.0.0 is known to work with Yi 0.6.6.0. Make sure that your Haskell compiler and tools are on your PATH.

First, you should install the current version of [http://www.haskell.org/platform/windows.html Haskell Platform for Windows]. The version 2012.4.0.0 is known to work with Yi 0.6.6.0. Make sure that your Haskell compiler and tools are on your PATH.

−

Next, you should install [http://www.gtk.org/download/win32.php GTK+ for Windows]. You have to use "All-in-one bundles", not indivisual packages. Download and unpack the archive, then again make sure that GTK+ utilities are on your PATH.

+

Next, you should install [http://www.gtk.org/download/win32.php GTK+ for Windows]. You have to use "All-in-one bundles", not individual packages. Download and unpack the archive, then again make sure that GTK+ utilities are on your PATH.

Now, you can invoke cabal-Install from the command prompt.

Now, you can invoke cabal-Install from the command prompt.

Line 89:

Line 89:

== FAQs ==

== FAQs ==

−

{{/FAQ}}

+

{{/FAQ}}

== Contribute ==

== Contribute ==

Line 95:

Line 95:

Fork the source on GitHub and send pull requests for merges. Or consult the yi-devel mailing list. Patches are always welcome. :)

Fork the source on GitHub and send pull requests for merges. Or consult the yi-devel mailing list. Patches are always welcome. :)

−

Otherwise, see [https://github.com/yi-editor/yi/issues the complete list of open issues] here.

+

Otherwise, see [https://github.com/yi-editor/yi/issues the complete list of open issues] here.

−

(Note you can start working on all issues in

+

(Note you can start working on all issues in

−

New/Accepted state, regardless of the owner of the issue.

+

New/Accepted state, regardless of the owner of the issue.

-- you can send an email to the list with your plan if unsure)

-- you can send an email to the list with your plan if unsure)

−

Post your questions and follow up on [http://groups.google.com/group/yi-devel the yi-devel mailing list].

+

Post your questions and follow up on [http://groups.google.com/group/yi-devel the yi-devel mailing list].

Some other pending tasks are described below.

Some other pending tasks are described below.

Line 111:

Line 111:

* All people with write access can apply patches without prior approval. If one thinks a patch would be controversial, it might be a good idea to discuss it on the list though.

* All people with write access can apply patches without prior approval. If one thinks a patch would be controversial, it might be a good idea to discuss it on the list though.

−

* Try to not break the build. (By Murphy's law, if you do so it will happen at the most annoying moment...) So, always try to build before pushing patches. Bypassing Darcs's test build to record a patch indicates you should further improve your patch.

+

* Try to not break the build. (By Murphy's law, if you do so it will happen at the most annoying moment...) So, always try to build before pushing patches. Bypassing the test build to record a patch indicates you should further improve your patch.

* [[JeanPhilippeBernardy | I]] can at any time rollback a patch for whatever reason. This however should not upset the author of the patch. Most contributions are welcome, so a patch revert normally would only mean that a detail or two need to be worked out. (e.g. it breaks an important feature in some configuration, etc.)

* [[JeanPhilippeBernardy | I]] can at any time rollback a patch for whatever reason. This however should not upset the author of the patch. Most contributions are welcome, so a patch revert normally would only mean that a detail or two need to be worked out. (e.g. it breaks an important feature in some configuration, etc.)

Line 120:

Line 120:

*Evolution to an IDE:

*Evolution to an IDE:

:Show exact location of compilation errors: 80% of a Haskell project

:Show exact location of compilation errors: 80% of a Haskell project

−

:Support for the GHCi debugger & others: 10 % of a Haskell project (Added bonus: greath for learning: trough the debugger, people learn the real execution flow of a Haskell program. Better if this is done inside an editor)

+

:Support for the GHCi debugger & others: 10 % of a Haskell project (Added bonus: great for learning: through the debugger, people learn the real execution flow of a Haskell program. Better if this is done inside an editor)

−

:Integration of refactoring tools : 5 %

+

:Integration of refactoring tools : 5%

:Edition: only 5%

:Edition: only 5%

−

−

*An extension to GHCi to support documentation of symbols.

+

+

*An extension to GHCi to support documentation of symbols.

:This seems to be (reasonably) straightforward, as GHCi already has :info. It would mean hacking the type environment (what about values?) to add documentation information. The main problem would seem to be populating this --- maybe hack haddock to produce something from the library docs? I assume that using package GHC uses the parent RTS (package GHC seems to be the way to go, but more investigation is required --- don?)

:This seems to be (reasonably) straightforward, as GHCi already has :info. It would mean hacking the type environment (what about values?) to add documentation information. The main problem would seem to be populating this --- maybe hack haddock to produce something from the library docs? I assume that using package GHC uses the parent RTS (package GHC seems to be the way to go, but more investigation is required --- don?)

Line 138:

Line 138:

*Haddock documentation

*Haddock documentation

−

:(no brainer), maybe associate with .hi files for binaries.

+

:(no brainer), maybe associate with .hi files for binaries.

*Maybe a class <code>YiShow</code>, which all config items must be a member of? This is to emulate describe-variable

*Maybe a class <code>YiShow</code>, which all config items must be a member of? This is to emulate describe-variable

Line 210:

Line 210:

; Introspection of e.g. what processes are running.

; Introspection of e.g. what processes are running.

−

: There are already libraries in Haskell for processes, but they don't give Yi any extra information --- we really want a layer on top.

+

: There are already libraries in Haskell for processes, but they don't give Yi any extra information --- we really want a layer on top.

1 About

Yi is a text editor written in Haskell and extensible in Haskell. The goal of Yi is
to provide a flexible, powerful and correct editor core
scriptable in Haskell.

Features:

A purely functional editor core;

Keybindings written as parsers of the input;

Emacs, Vim and Cua (subset) emulations provided by default;

Vty and GTK+ w/ Pango(via Gtk2Hs) frontends.

The long term goal of the project is to make Yi the editor of choice for Haskell hackers.

The main short term goal is to maximize Yi's Fun Factor. This includes:

Improve hackability (and therefore architecture)

Add cool features

2 Get Yi

2.1 From Hackage

Yi depends on the Haskell Platform which must be installed. Many Haskellers haven't installed this explicitly, as they have already installed most of the utilities it contains; to be sure you have everything that is needed, it is recommended that you explicitly install the Platform.

2.3 Platform Support

2.3.1 GNU/Linux

2.3.2 Mac OS X

The easiest way to get Yi for Mac OS X is currently no different from the above. There is also a Yi release in MacPorts, but it might be very old, deprecated one. Please use the Hackage version instead.

2.3.3 Windows

The current version of Yi on Hackage (0.6.6.0) can be built on Windows.

First, you should install the current version of Haskell Platform for Windows. The version 2012.4.0.0 is known to work with Yi 0.6.6.0. Make sure that your Haskell compiler and tools are on your PATH.

Next, you should install GTK+ for Windows. You have to use "All-in-one bundles", not individual packages. Download and unpack the archive, then again make sure that GTK+ utilities are on your PATH.

If you want GHC API special capabilities, you have to download, configure, build and copy separately:

cd yi
cabal configure -fghcAPI
cabal build
cabal copy

Compilation fails with a message about alex not being available?

Currently, Cabal doesn't track programs, just libraries, so it won't warn you if you are missing Alex (as many people are). The solution here is to just cabal install alex first. (Yi uses Alex to generate code for parsing stuff with syntax, like Haskell source.)

I can't install yi-gtk or yi-vty! It wants sourceview or something.

As the Hackage descriptions say, yi-gtk and yi-vty are only for versions of older than Yi 0.3. You really should be running the latest development (GitHub) or stable (Hackage) versions of Yi, so don't try to install these two packages. Yi supports VTY and Gtk2hs directly in the yi package now.

6.2.3.9 C, C++ and Java Modes

6.3 Development

Fork the repository on GitHub, then clone your version to your machine. Push to your repo on GitHub, and then make merge requests.

What are some of the dependancies?

There is a rather long list of dependencies for Yi, check the yi.cabal file for a list.

If you are on Mac OS X and are using MacPorts, then these will not be included in the GHC in that distribution. Many of the dependancies are in MacPorts (for example: ghc, ghc-devel, alex, and gtk2hs). However, you may have some trouble building with Cabal-1.5.2, since it is a development version of Cabal. To work around these issues, you might have to add the line "Build-Type: Simple" to the .cabal files in the above required packages.

6.4 Configuration

6.4.1 How to Configure Yi

A good way to start is to copy yi.hs in your $XDG_CONFIG_HOME/yi directory (create it if needed, usually ~/.config/yi), and hack as needed.

6.5 Usage

6.5.1 GError on startup

I get the error message "yi.exe: <<System.Glib.GError.GError>>" when I try to run yi.

Sometimes this is a result of yi not being able to find the contents of the art directory when trying to start in graphical mode (e.g. Gtk or Pango). Check that the install has be done correctly or use the VTY mode ($ yi -f vty).

For more detail on the error, modify main in Yi/Main.hs to catch GError:

Note that more recent versions of Yi (e.g. from the GitHub repo) no longer simply display the anonymous GError but instead provide a more detailed error message (making the above code snippet unnecessary).

7 Contribute

Fork the source on GitHub and send pull requests for merges. Or consult the yi-devel mailing list. Patches are always welcome. :)

7.1 Write access policy

One does not need write access to the repository to contribute. Please fork the main repository and send pull requests.

Write access can however be granted, with the following disclaimer:

All people with write access can apply patches without prior approval. If one thinks a patch would be controversial, it might be a good idea to discuss it on the list though.

Try to not break the build. (By Murphy's law, if you do so it will happen at the most annoying moment...) So, always try to build before pushing patches. Bypassing the test build to record a patch indicates you should further improve your patch.

I can at any time rollback a patch for whatever reason. This however should not upset the author of the patch. Most contributions are welcome, so a patch revert normally would only mean that a detail or two need to be worked out. (e.g. it breaks an important feature in some configuration, etc.)

8 Yi Ideas

This section is meant to gather ideas people have for Yi.

Evolution to an IDE:

Show exact location of compilation errors: 80% of a Haskell project

Support for the GHCi debugger & others: 10 % of a Haskell project (Added bonus: great for learning: through the debugger, people learn the real execution flow of a Haskell program. Better if this is done inside an editor)

Integration of refactoring tools : 5%

Edition: only 5%

An extension to GHCi to support documentation of symbols.

This seems to be (reasonably) straightforward, as GHCi already has :info. It would mean hacking the type environment (what about values?) to add documentation information. The main problem would seem to be populating this --- maybe hack haddock to produce something from the library docs? I assume that using package GHC uses the parent RTS (package GHC seems to be the way to go, but more investigation is required --- don?)

Views on data

Rather than just editing a file, you would open a view onto the file, i.e. there is no longer a 1-1 correspondence between buffers and files. Why? Well, for aggregate buffers (i.e., editing multiple files in the one view), or for multiple views of a file (e.g. AST and source-level). There would be some primitive ops for editing a buffer (insertChar, delete, etc.), which would then call update functions on anything observing that file.

Support for Perl style regular expressions

Emacs regexes don't support the same set of features; Perl regexes are more tersely powerful. This could be a good feature for luring users from vanilla Emacs.

Remote attach so I can work from home, but still use a remote machine

Like Emacs's server?

Haddock documentation

(no brainer), maybe associate with .hi files for binaries.

Maybe a class YiShow, which all config items must be a member of? This is to emulate describe-variable

Support for collaborative editing. This would be very good for #haskell work, and the text editor Gobby and its Obby protocol seem to provide a candidate way of doing things.

8.1 Borrowing from other editors

Take some ideas from Emacs, some from vi, but don't stick them all together without a single core philosophy. Otherwise, you'll end up with an editor that looks like it was thrown together. Some people come from an Emacs background, some from vi, some from elsewhere, and ALL of them will want Yi to behave like their regular editor. The best way to do this is to have a single person make all the decisions on behavior.

8.1.1 Emacs

Coming from an Emacs background, I think a few things are essential,
mainly the introspection capabilities of Emacs.

8.1.1.1 Emacs goodness

The following are things I like about Emacs, as an extensible
environment, and miss in Yi:

Really good online documentation

Emacs can tell you a lot about a function or variable with a keypress--- the current value, where it is declared, and a hypertext formation string

Hooks-Extensibility

All (good) apps allow users to extend, through, e.g., hooks --- a list of functions that are run before/after some event (like saving a file)

8.1.1.2 Emacs badness

So, why replace it?:

ELisp

Dynamically scoped, Dynamically typed, ugly, old. 'Nuff said

What's a Parser?

A lot of apps in emacs do stuff with text, usually text that is in some language. There is no standard parser (like, e.g. parsec), so a lot of it is ugly handwritten spaghetti. This also means that adding analysis tools isn't really done (or done nicely).

ELisp again

Haskell is a lot cleaner to write, especially because of the large number of libraries.

8.1.1.3 Emacs maybeness (?)

Some things that are sometimes bad, sometimes good:

Everything is a buffer

Makes some sense, but sometimes doesn't. It is nice to have uniform key bindings do the right thing (e.g., C-Space sets the mark, and the region can then be used, e.g. to delete a sequence of emails in Wl) Sometimes, however, you just want some sort of GUI widget.

OTOH, having the minibuffer be a special kind of buffer is a good idea.

Properties

It is possible to associate arbitrary properties with symbols. This means you can annotate a symbol and then use that information at a later date

8.1.2 Vim?

good things

modal key editing -> configuration system is powerful enough!

light weight -> fast startup -> yi has this :)

8.2 Ideas

8.3 Implementation

Considerations:

Interface to the runtime

The scheduler, docs, etc.

Introspection of e.g. what processes are running.

There are already libraries in Haskell for processes, but they don't give Yi any extra information --- we really want a layer on top.

...

9 Trivia

Y I is the most recursive acronym. (Read it as combinators).

義, pronounced yi, means righteousness, one of the five virtues of confucianism.