Text editor using c

Hi, I want to create a text editor using c. I do not want to create a graphical interface, the text editor will be a console application. I would like to ask if there are libraries that implement some basic functions, for example, I want to execute a function when the user press ctr + s.

+4
source share
4 answers

You will want to look into the curses library. There are versions for most Unix-like systems, as well as for console programs on Windows (and probably programs running PowerShell, but not sure).

This library has functions for reading keystrokes, moving around the screen and drawing window borders using ASCII characters or terminal graphics in an independent platform / terminal. Some versions even have the ability to work with mice.

There are many more curses that can help you, but it will be difficult for you to understand this until you read more about it and see some examples in action (and you really understand that they use curses).

The most popular version for free * nix systems is ncurses, and the Windows version is called pdcurses.

+2
source

Curses and other similar libraries are a good place to start.

http://en.wikipedia.org/wiki/Curses_%28programming_library%29

0
source

Use ncurses and see the source code for vim .

0
source

On my web page you can find a simple ncurses-based text editor:

http://www.melvilletheatre.com/articles/cstuff/1.html

0
source

Source: https://habr.com/ru/post/1332413/


All Articles