6 ms·
Show HN: A simple, tiny Vim and kilo-inspired editor
- sewer_bird 9y ago"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 9y ago"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
- otikik 9y agoA lot of those languages don't come activated by default on the packaged versions of Vim - Lua is one of them, at least on osx/homebrew. That strongly dissuades me from writing plugins in anything other than Vimscript. It might work for the guy who recompiles his Vim often, but it will not work on that vim instance running in your server. Ubiquity is one of Vim's main points.
- nerdponx 9y agoDoesn't Vim have Lua support too?
- humanrebar 9y agoI know there are plugins for the lua file type (syntax highlighting, etc.). I don't know if you can write plugins in lua.
- sigzero 9y agoLua is a valid language to write plugins.
- jmcphers 9y agoNeovim does, and it will be a first class scripting citizen in 0.3. https://neovim.io/roadmap/ https://neovim.io/roadmap/
- hellerve 9y agoYeah, the comment was a little tongue-in-cheek. I didn’t think just writing yet another Vim clone would be very interesting, whereas trying to keep it minimal yet usable would be an interesting challenge.
- widdma 9y agoIf you're after something lightweight, similar enough to be vim to be useable, and lua built-in checkout vis: https://github.com/martanne/vis https://github.com/martanne/vis The structural regular expressions are also pretty interesting.
- stevekemp 9y agoMy own fork of Antirez's kilo was created specifically to add Lua support: http://github.com/skx/kilua http://github.com/skx/kilua Having even basic support, for key-bindings, and reacting to events, is very useful. I wrote a console-based mail client which is configured and scripted via Lua, and would love to see Lua added to "all the things".
- alphaalpha101 9y agoI actually really like Vimscript. It has features that many popular languages lack or have only recently got, like destructuring let [file, line, col] = split("hello.c:39:10", ":") This is the sort of feature I just assumed it didn't have, because few enough real programming languages have it. The main issue I think is that there are lots of different contexts where you can put vimscript, and different bits of vimscript are legal in those contexts, or at least seem to be.
- knodi 9y agocan it display images, like imgcat?
- hellerve 9y agoHeh, 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.
- Gedeost 9y ago"wasd" keybindings got my vote!
- marklgr 9y agoNot all keyboards have a qwerty layout.
- hellerve 9y agoYou can shoot pretty much any keybindings down with that argument, though. hjkl makes about as much sense on Dvorak as wasd.
- marklgr 9y agoI 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 9y agoI 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.
- michielderhaeg 9y agoAzerty, it's used in France and Belgium and maybe some other places too.
- marklgr 9y agoI'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
- clarry 9y agoIt'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.
- hellerve 9y agoI was actually scolded—by a friend—for not using curses, but I honestly prefer working with escape sequences. Is your editor available on Github?
- clarry 9y agoI really think curses causes more problems than it solves, today. It made sense back when terminals were hardware, and communications with them were really slow. Today? Explain to your friend what he needs to do when he connects to the solaris server on his campus, using rxvt-unicode, and all curses-using applications are completely broken. How to compile & install the terminfo file, where to get it, where to put it, and what to do because "rxvt-unicode" is too long a name for the implementation. Then explain to him why software won't use ansi standard codes that would just work. Nah my editor is not on github. I figured that I'm only writing it for myself anyway; any rational people should be happy with nvi or vim or one of a few dozen other editors. And the few stubborn ones like me will want to write their own editor anyway. :-)
- msla 9y agoIt'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.
- jlg23 9y ago"Frankly", I'm always willing to learn: Any facts to back up your claims?
- Karrot_Kream 9y agoHow 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 9y agoIt 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!
- mileycyrusXOXO 9y agoI 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 9y agocloned 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