
Show HN: A simple, tiny Vim and kilo-inspired editor - hellerve
https://github.com/hellerve/e
======
sewer_bird
"feels like Vim, just different enough for you to be frustrated" is true, but
I like the Lua built-in: it's a fantastic language for this kind of thing, and
feels more inviting to a new plugin-writer than, say, Vimscript might.

~~~
humanrebar
"It isn’t widely known that Vim has interfaces into several popular scripting
languages: Python, Ruby, Perl, Scheme, and Tcl."

[https://items.sjbach.com/97/writing-a-vim-
plugin](https://items.sjbach.com/97/writing-a-vim-plugin)

~~~
nerdponx
Doesn't Vim have Lua support too?

~~~
humanrebar
I know there are plugins for the lua file type (syntax highlighting, etc.). I
don't know if you can write plugins in lua.

~~~
sigzero
Lua is a valid language to write plugins.

------
clarry
It's nice to see another editor that uses straight ansi escapes instead of the
bloated legacy database of glass terminal incompatibility & its associated
clumsy library. :-)

I did a similar thing, but it's more or less vi with some subtle differences
that would make any vi user mad.

~~~
msla
It's bad to see someone ignoring previous work done and assuming that doing
things by hand necessarily means doing it better or more efficiently. ncurses
has optimization routines in it, and replicating them in your own project is
bloat and, frankly, not something you're likely to do better.

~~~
hellerve
I neither ignore it or assume I can do it better. I just did it because it was
fun and satisfying.

I don’t believe I could do better than curses/ncurses. What I do believe,
however, is that replicating the work isn’t always bloat. If you’re only going
to use a small subset of the library anyway, replicating a bit of it might
actually be less bloaty than including the whole thing. That said, when in
doubt using pre-made solutions surely is better _if_ you’re working in a
professional/production-grade environment. I on the other hand am just playing
around and seeing how far I can take this.

~~~
samoright
+1

Projects like these are always welcome on Hacker News. I am saddened to see
comments like the parent's (that are too eager to discourage any technical
decision that does not conform to their opinion) popping up in this community
often.

The very purpose of the "Show HN" prefix is to show off fun projects like
these to the HN community and the more such projects we have (regardless of
what technical decisions were taken to create the project), the better it
serves that purpose.

------
mileycyrusXOXO
I made my own Kilo and have wanted to eventually build it into something like
this (Vim-ish and Lua extensible.) Eventually, I will find the time.

Good stuff!

------
kimusan
cloned the source and tried to build....failed. had to add -lm -ldl and remove
-Werror in the Makefile in order to get it to even build. After that I got a
binary "e" but running it just exits right away without any output. Seems like
a bit more work needs to go into this editor before it is ready for the public
:-)

tested on Ubuntu Linux

------
Karrot_Kream
How hard is it to run it modeless? Also I love projects like this, so thanks!

GNU Zile
([https://www.gnu.org/software/zile/](https://www.gnu.org/software/zile/)) is
another one I really enjoy with a more emacs focus (i.e. modeless) (but again,
changeable in any direction you want with Lua).

~~~
hellerve
It shouldn’t be too hard:
[kilo]([https://github.com/antirez/kilo](https://github.com/antirez/kilo)),
the editor on which this is partially based, is modeless. All of the modes are
thus addons that I’ve built. You’d have to tweak a bit of the code to make it
usable as a modeless editor, but it could definitely work!

------
Gedeost
"wasd" keybindings got my vote!

~~~
marklgr
Not all keyboards have a qwerty layout.

~~~
hellerve
You can shoot pretty much any keybindings down with that argument, though.
hjkl makes about as much sense on Dvorak as wasd.

~~~
marklgr
I was referring to some stock non-US keyboards, not alternative layouts like
Dvorak. hjkl is lined up the same way on most keyboards I have seen.

~~~
hellerve
I actually didn’t know wasd weren’t always in the same place and hjkl were. Do
you know any of these layouts at the top of your head? It might come in handy
next time when I think about typing UX.

~~~
marklgr
I'm typing on an AZERTY keyboard (used mostly in France and Belgium, and a few
other countries according to Wikipedia). I'm not suggesting not to use wasd by
default if people like it, just try and make it customizable for people with a
non-QWERTY keyboard.

[https://en.wikipedia.org/wiki/AZERTY](https://en.wikipedia.org/wiki/AZERTY)

~~~
hellerve
Thanks for telling me. Github issue is filed:
[https://github.com/hellerve/e/issues/10](https://github.com/hellerve/e/issues/10)

Will work on it when I find time.

~~~
marklgr
Nice, thank you.

~~~
hellerve
I fixed it now! You can script it through Lua. (through `set_left(<char>)`
etc.)

------
knodi
can it display images, like imgcat?

~~~
hellerve
Heh, that actually sounds like a fun thing to implement. But no, as of yet it
can’t.

And when I think about having to adhere to my "as few dependencies as
possible" standards, which basically means I’d have to implement a bunch of
image file parsing, I think I’d rather not. I just saw imgcat uses CImg for
that, which seems like a smart move.

