
Edit: A Relaxing Mix of Vi and Acme - qznc
http://c9x.me/edit/
======
mpu
I'm glad to see such a positive reaction! I worked on that for quite a while
and use it daily. I think the code is of pretty good quality (never had a
segfault or data loss while using it). If you try it and encounter annoyances
because it does not behave exactly like what you want, you have to hack in the
code! I will never fix something myself if it does not annoy me. This does not
mean that I did nothing for you, instead I tried a lot to make the code such
that everybody can hack it, it is very regular, short, simple and occasionally
well documented (vicmd.w, buf.c).

I spent a probably unreasonable amount of time thinking on its design and I
believe I came up with something satisfying, the code is only 3000 lines but
one or two features I want remain to be hacked in. The undo and the buffer
data structures were tested automatically for several hours with success (see
the tools/ subdir), no data was ever lost. The file saving command is even
formally proved correct in Coq.

Any suggestion that could simplify the logic and preferably decrease the line
count is more than welcome.

Also, note that the version showed in the video is a bit deprecated, the
master branch now supports better handling of async commands and window splits
(vertical and up to 6 windows) with resizes using the mouse.

Some are concerned about the license. It is public domain. But please tell me
if you do something cool with it or like it.

~~~
fmoralesc
Everything about this awesome, really.

------
micheljansen
Looks like there are some differences with vi, among others:

* "dd" is not implemented, use "d_"

* "cw" will not work as in vi, use "ce" or "cl"

* "r" is not implemented, use "cl"

I think these are very common mnemonics, so I wonder why they are not
implemented and if there are any plans to do it in the future. I use these all
the time, so this would be a major turnoff for me.

~~~
xiaq
Because they are not very reasonable?

* "dd" isn't reasonable because it violates the "command + movement/region" structure of vi commands. So is "cc" and "yy". None of "c d y" is not a movement or region. Presumably in this editor "_" represents the "whole line" region, which leads to also "c_" and "y_". Much more regular although it does require you to lift your finger one more time.

* "cw" isn't reasonable because "w" as a movement usually means "to the next word", but in "cw" it means "to the end of current word" instead. "ce" is indeed better.

* "r" is actually not bad (indeed "rx" is equivalent to "clx<Esc>", but the former requires 2 keystrokes), but I guess it's because the author rarely uses it.

Anyway the editor is pretty small, it might be easy or even fun to hack it! :)

~~~
dllthomas
_' "cw" isn't reasonable because "w" as a movement usually means "to the next
word", but in "cw" it means "to the end of current word" instead. "ce" is
indeed better.'_

I've recently been noticing this - dw behaves like dw, but cw behaves like ce
and there's no way to express a real cw in a short number of keystrokes.
Despite it breaking my muscle memory, I believe I _approve_ of this change.

~~~
philh
> there's no way to express a real cw in a short number of keystrokes.

dwi is pretty short.

~~~
dllthomas
... but not a single action. This is important when I want to repeat things.

~~~
philh
Good point. It seems likely that caw will suit most of the time, but I can't
think of an exact replacement.

~~~
dllthomas
Right, caw is probably the closest; cf<Space> is what I defaulted to earlier
in my vi-ing, which is a little further away but also _usually_ close enough.

~~~
gpvos
Thanks, I didn't know about caw, because I learned vi on Solaris, which had
real vi and not vim.

~~~
dllthomas
The a and i modifiers are great things - they can also be combined with most
grouping characters (parens, brackets, braces, quotes).

------
GuiA
> you will also need cweb because one file is written in literate programming

Glad to see there is a small village of indomitable programmers still holding
out against the invaders :)

~~~
computer
It's still fairly alive in the academic community, with things like
Sweave/knitr/IPython workbooks/Maple stuff/etc.

------
roberthahn
I hope the author of Edit is reading this thread. This sounds like a dream
come true! The best form of encouragement is people using the software, but if
the author wants us to wait, I'm cool with that - but I hope they make real
progress quickly!

Now I have the itch to fire up and work in Acme again :)

------
prawks
For people not familiar with Acme, I found this 20-minute video tour very
informative:

[http://research.swtch.com/acme](http://research.swtch.com/acme)

~~~
rcarmo
Also, I asked HN about modern Acme clones recently:
[https://news.ycombinator.com/item?id=8269442](https://news.ycombinator.com/item?id=8269442)
(glad this came along)

~~~
fmoralesc
I'm the developer of plan9-for-vimspace[1], which you mentioned in your
thread. I've not been very active with it, because I came up against some
limitations in vim, but I really want to go further with it.

I would really like some feedback on what stuff should go in or out. I've
thought a lot on how to implement acme's tag lines and a plumber system (just
this weekend, I was thinking of providing a fuse-based system for that).

[1] [https://github.com/fmoralesc/plan9-for-
vimspace](https://github.com/fmoralesc/plan9-for-vimspace)

~~~
tsuraan
Were the issues you hit being addressed by neovim
([https://github.com/neovim/neovim](https://github.com/neovim/neovim))? They
seem to be pretty interested in making a more extensible vim.

~~~
fmoralesc
Not yet, the plugin API is not yet stable. One thing I needed for this was
something like multiple selections, which is not in the roadmap. I also wanted
to implement moving the mouse cursor like acme does on movements, but that
currently would require vim to provide more info about its display (also not
in neovim's roadmap, especially since it doesn't provide a GUI yet).

For the first point, I can hack something up with the recently merged (by
yours truly) `matchaddpos()` function, and I think I will do so this week.
I've been also toying with computing a character's position in vim's display
taking into account splits, but that has proven to be very hard.

------
demetrius
A wonderful idea, but in the current state I can’t use it since it doesn’t
support entering Cyrillic.

In fact, vim doesn’t do the right thing with Cyrillic either (vim binds
commands to entered characters, not keys; so when entering Cyrillic you either
have to switch layouts when entering commands — or do some ugly hacks), but
it’s at least usable. Edit is not, right now.

------
mzs
That's neat, it reminds me of MPW and the scheme interpreter I used long ago
on a mac, wish I could remember which one now. They had a worksheet where you
could go back to a previous line with the keyboard or mouse and hit enter
there (or edit it first and hit enter then) to execute. I had a very nice
worksheet with lots of templates I would follow.

~~~
wanderer
Eddie(Text Editor) by Pavel Císler has a worksheet like that.

------
xiaq
I found this in the doc/ subdirectory of the repository:
[http://c9x.me/git/?p=ed.git;a=blob;f=doc/republic.txt;h=366f...](http://c9x.me/git/?p=ed.git;a=blob;f=doc/republic.txt;h=366f1543a185a1b2f6c5b4e8dbeac82715c15ee5;hb=HEAD)

I am really curious about what the full text of Republic is doing here...

~~~
jekub
Its probably for testing purpose. Its a big file of natural text so you can
easily checks a lot of things with it and its a lot less boring than pages of
lorem ipsum...

But, its funny that it is more than half of the full content in the git
clone...

~~~
xiaq
Ah, indeed. It turns out that the "doc" actually means "text documents"
instead of "software documentation".

------
bulte-rs
Lovely.... Now to get some command line utils to interact with a clojure repl
and some form of splits (i.e. for documentation).

This is actually something I might contribute to! :P

edit: async is already in... mea culpa

~~~
mpu
Splits are available in the git master branch.

~~~
bulte-rs
just noticed; very awesome. For some reason this editor gives me the same
feeling I had "back when I was little" when I was using IDE's like Turbo
Pascal's. It just feels... modern retro!

------
rcarmo
Very nice. Wish it was on Github for easier contributing (and issue tracking).

~~~
bru
>easier contributing

Er... what? What's hard about contributing? You don't have to go through a web
interface for everything? IMHO that makes it easier.

    
    
        $ git clone git://c9x.me/ed.git
        <do your changes>
        $ git format-patch --cover-letter <any other options you want> <commits>
        <edit the file if you want>
        $ git send-email <the file>
    

`man git send-email` will tell you anything you need to know: configuration
options, examples... If is well-written and straightforward! Seems like the
author isn't interested in public issue tracking (yet), and using Github
wouldn't have changed that.

I, for one, celebrate that he's not using Github. I'm very afraid of the git
== github trend I'm seeing amongst many people (technically semi-literate or
even technical people)

~~~
allegory
Excellent points. Monocultures are terribly harmful, especially in the open-
source side of things. While github is convenient, it's not the right answer
for a lot of things and terribly inconvenient for others.

I use git without github. I use it with vim outliner and keep the issues in
the repo.

~~~
bru
You use vim outliner plugin for the issues? How does that work?

Are your issues simple text files describing it? In a "issues" folder? Do you
enforce a format? How do you track their status?

~~~
allegory
Yes. Indent per issue. One .otl file with all issues in it. No format enforced
although I'm pretty consistent at writing issues. Once complete the issue is
simply deleted. I've done this up to 4 people and it has worked wonderfully
even though they had to learn vim :)

You can pipe it through awk to remove any lines starting with a space/tab,
sort it then then diff the result with earlier versions to work out progress
etc as well.

------
imanaccount247
This is fantastic. I felt like I was alone in thinking acme is great, but is
missing a text editor. Nice to see I'm not the only one.

------
imanaccount247
I might just be missing it, but I don't see the license mentioned anywhere.
Anyone know what it is?

~~~
mpu
I hacked it. It's public domain for now. I might (or not) switch to MIT later.

~~~
fmoralesc
I don't think that's possible. If it's public domain, none can claim
copyright.

