Show HN: I made a curses-based texteditor in 2kb of code. “Two Kilo”

Show HN: I made a curses-based texteditor in 2kb of code. “Two Kilo”

R realloc
#define A(s)calloc(1,s)
#define M memcpy
#define C strcpy
#define L strlen
#define B break;
#define U file”)strcmp(v[1],”-h”)||P(“^x to read file”)
v= A( S*2);v[0 ]=b; while(read(
f, c ,1))if(c ==1 +9)v=R(
v,S*(2+( ++h))),v [h]=A(1) ,X =0;else( v[h]
=R(v[h], ++X+1)), v[h][X-1 ]= c,v[h][X ]=0;
close(f); initscr( );noecho () ;keypad( stdscr,
1);U;for (;1+1;){ ;switch( c= getch(), erase
(),r(),c ){case 8 +8 +8 :; goto Q;; case 260:
x=x?x-1: y-1? –y, L ( v[ y]):x;B; case 261:
x=(x-L(v [y]))? MIN (x,L (v[y])-1)
:0;B;case(263):if( !

Source: 0x0.st