We finally have a functional editor, were you can open a new or existing file, modify it, and save it to the disk! I still need to add more functions to it, but im happy to say that you can try it already.
For now it only works for C programming language, in the future i will update it with more fuctionalities and other languages support.
-
Clone the repository:
First of all we need to clone the git repository on our local machine. Fire up your prefered terminal and type in
git clone https://github.com/nikiene/simple-text-editor.git
-
Get inside the project's folder:
cd ./simple-text-editor
-
Setup:
Install the GCC C Compiler and the Make program.
For Windows users:
You will need to install some kind of Linux environment on your machine. You can use a Virtual Machine or WSL (Official Microsoft WSL guide: https://learn.microsoft.com/pt-br/windows/wsl/about). After installing your preferred Linux distribution, you will need to run this command inside the bash:
bash sudo apt-get install gcc make
For Mac users:
Run this on your terminal:
xcode-select --install
For Linux users:
Run this on your terminal:
sudo apt-get install gcc make
Now that everything is set up, we can actually run the program!
-
Running:
To run the editor is very simple:
Inside the project folder just type in this command:
make
It compiles the code and generates an executable.
After you have succesfully compiled the code just type in this command to create a new file:
./main
Or you can specify the path to the file you want to open:
https://viewsourcecode.org/snaptoken/kilo/01.setup.html
https://www.averylaird.com/programming/the%20text%20editor/2017/09/30/the-piece-table