Jotter

It´s an text editor by Joel, so Joel + Text = Jotter (Thanks ChatGPT!)

Why?

Idea behind making this text editor was to find a project in C that would allow me to handle string buffers. I also read somewhere of an senior software engineer who used his own code editor for work and was inspired. I dislike using VSCode, as Microsoft could try to further monetize my codewriting. So this could be a solutions for that. Another way of escaping the Microsoft monopoly of IDEs would be to use nvim.

However before getting into nvim, I wanted to get a better appreciation for text editors by writing my own.

So how does it work?

The technologies used are ncurses and C. ncurses is an old-ass C library for writing GUIs for CLI programs. It abstracts away having to use ANSI escape codes which are in-band sequences that are not interpreted as text but as commands in the terminal you are using. The ANSI standard for escape codes spread to wide use in early 1980s. C was chosen because I wanted to to implement my own data structures and handle buffers manually.

You can try to open up a terminal(in linux based systems) and type this in: echo -e “\x1B[48;5;204myolo”, it should turn your echo background to pink. This can be used to make a plethora of different effects, including a complete GUI in the terminal window, and is used by ncurses.

Getting ncurses to work

So I started writing ncurses, and found this old documentation/tutorial to do it.

What is an text editor?

  • open a file
  • save file
  • navigate
  • exit

Requirements

  • Build tools for C (gcc)
  • ncurses

Installation

  • Copy repo
  • Run ´bash editor.sh´ to build from source
  • symlink bin/jotter to PATH

Usage

  • do jotter <path-to-file>
  • move with arrow keys
  • CTRL-S to save
  • CTRL-C to shutdown

Future

I will most likely be using neovim so this might evolve into something else than an text editor at some point

In the future Im going to use nvim however, although something like this would give great customization for your code editor, I think I would end up building something neovim-like anyways. :D