Feedback for these lessons is very much welcome. If you like or hate something about a lesson let us know, either on GitHub, via Mail or just tell us in person :)
x
We want to edit!
Vim, Nano and emacs are console editors. But what if we want to build our own? Here it comes!
Build the frame
First we have to create a screen with curses so we can build our CLI around it.
The editor itself
In order to have an editor, we need a field to edit and write something: a textbox. Maybe with a nice frame around it?1
Where?!
The editor is working but it is not useful if you can not save the file…
Add an open_file
function which opens (or creates) a file to write the data in.
Save it!
Don’t forget to save the file when you are done editing!
Make the creator an editor
For now we can only create new text files that overwrite the old ones… Time to load the old text!2