Earlier quoted context omitted.
Yeah but that is so much less usable. Quick, which one is up?
"k", as "k" glyph reaches higher from the two. And conversely, "j" reaches lower, so it moves down.
Writing an editor in less than 1000 lines of code, just for fun
131–140 of 146 posts
Re: Writing an editor in less than 1000 lines of code, just for fun
#132Awesome. When I saw all the things it could do in so little code, I assumed a higher level language would be used. But, nope...plain old C with the usual standard libraries. The parser for the syntax highlighting is super cool. Concise and declarative definition of the syntax (well, the keywords, anyway), in HL_keywords, and then maybe 150 lines of code for the parser. I doubt it would work well for a much more compl…
Perl can not be parsed, making accurate synthax highlighting impossible: http://www.perlmonks.org/?node_id=663393
Re: Writing an editor in less than 1000 lines of code, just for fun
#133Earlier quoted context omitted.
"k", as "k" glyph reaches higher from the two. And conversely, "j" reaches lower, so it moves down.
You're right, that is much more usable than having an up button in the up position with an up arrow on it...
Re: Writing an editor in less than 1000 lines of code, just for fun
#134Earlier quoted context omitted.
The point is, they are no longer in symbolic memory. At this point they are muscle memory. Quick, which muscle do you use to move your right thumb in? Does it matter?
Exactly: muscle memory. In your car, do you move the turn signal lever up or down to indicate a right turn? It actually takes longer to answer this question than to do the action in real life. Another example: There are several passwords that I can type instantly, but I wouldn't be able to recite them.
Re: Writing an editor in less than 1000 lines of code, just for fun
#135Honestly, this is the most exciting and inspiring project I've seen on HN in years, by far. I love that it's a fully usable terminal-based text editor that has zero dependencies . Just perusing the source code has been extremely interesting and educational for me already, and it's only been 5 minutes. Definitely gonna bookmark this project and hack on it! The TODO list looks like a good start, especially the xterm-ba…
Re: Writing an editor in less than 1000 lines of code, just for fun
#136Cool :) But editor without undo/redo is a bit surprising these days, next release?
Re: Writing an editor in less than 1000 lines of code, just for fun
#137Earlier quoted context omitted.
Speaking HTTP is worse in almost every way to using CGI: harder to implement, loses meta information (suppose you put an application at /app/ on your server... CGI handles it well, HTTP doesn't unless you do some extension since your server will see GET / anyway) and is harder to centrally log too. I think app servers speak HTTP more because it is kinda convenient for developers to run the local server without settin…
Nah, it's not worse: as nostrademons mentioned, you have your gateway server be a reverse proxy server, e.g. HAProxy, and then you can do whatever you want in there. Serve an application under /app/? No problem. Centrally log? Of course. Harder to implement? Not really, every major language has well-supported HTTP libs. And since you only need to know how HTTP works, rather than needing to understand HTTP and CGI, it…
Re: Writing an editor in less than 1000 lines of code, just for fun
#138Earlier quoted context omitted.
First, switch it to alternative screen mode... printf("\033?1047h"); then clear and move and such with other similar prints. See the list here : http://invisible-island.net/xterm/ctlseqs/ctlseqs.html It really is pretty simple. The big benefit of ncurses is if you want to target terminals other than xterm compatible ones, and they are so rare nowadays that you can really just ignore them.... Input is quite a pain tho…
I wonder if these codes work in cmd.exe now that Windows 10 TH2 supports (some of) the features.
Of course, you can run a terminal emulator inside the windows console and handle those sequences too! If I had to guess, I'd say that's what Microsoft would have implemented.
Re: Writing an editor in less than 1000 lines of code, just for fun
#139> Let’s say this again, “email client”. The notion of email client itself is gone at this point. Really? Is it lame to be using an email clients these days? I still use an email client (Thunderbird) because I can't stand the thought of all my mail sitting forever on Goggle's or whoever's servers. Yes, I know that they could have secretly archived all of my email the moment it was sent or received, and that my privacy…
> Really? Is it lame to be using an email clients these days? I think he means that wether nano is derived from an email client or not is not important
Re: Writing an editor in less than 1000 lines of code, just for fun
#140Earlier quoted context omitted.
You are being needlessly pedantic. The point is that typing "vi" into a terminal runs some application that implements a "vi-ish" interface. Whether it is ported vi or vim or vim-tiny has some effect on how nice that interface is to work with, but I would argue that most vim users would be able to get their configuration fixed or whatever
> You are being needlessly pedantic. I assure you I am not pedantic needlessly . The claim was "vi has some issues with arrow keys". Now tell me: which vi clone was elsurudo talking about? Because those are different projects . And Vim doesn't have a smallest issue with arrow keys (unless with "compatible" option set, I think, but I didn't use it for years and I may remember wrong).