Most people like to know what geniuses use to try to get closer to the masters.
The text editor that Linus Torvalds uses is one of the Emacs family, more precisely a modified version with specific (and private) lines to your liking. A modified version of MicroEmacs he called uEmacs.
The uEmacs license is free-noncomm, that is, it is free, but you cannot use it for commercial purposes. It is called uEmacs/PK , I don’t know why that PK in the name, but I read that it was incorporated by Petri H. Kutvonen, University of Helsinki, Finland. Maybe this acronym PK is the initials of the names of this guy who was quoted.
According to Linus Torvalds himself, he decided to modify it because MicroEmacs had an update and modified some things he liked from version 3.9 (“The best MicroEmacs ever” — Linus Torvalds), so he created his own version that has many of the features of this version(3.9) with a few more things added by it.
uEmacs is available on GitHub and also kernel.org. I can’t tell if your distribution has it in the repository, unless you have a Gentoo that has pretty much everything in the repository when it comes to developer tools!
So, to install using Portage, just run the command:
For other distributions you can clone the uEmacs repository and compile, but first remember to have the Ncurses development library, in addition to the binary build software: make and gcc. Examples:
After that clone the repository, it can be:
Via GitHub
Or via kernel.org
Now just compile and install, it’s so simple that it only comes with a Makefile
Note: If there is an “error” when compiling, see the additional step, otherwise ignore it!
Anyone who understands termcap
and ncurses
knows that there will be an error if we don’t pass the correct parameters to compile.
I, despite using the package compiled by Portage, tried to compile and got the error:
As soon as I read the name of this file and a word from curses.h
: tgoto , I already knew what the error was and I fixed it. If you have this same error, do this:
Makefile
file with your editorLIBS
that has this content:And add the -ltinfo, like this:
I even made a pull request if he accepts it will be about 10 years from now 😃 .
And then compile again: make && sudo make install
, the binary is em
.
The command to open the editor without any files is:
To get help, run em --help
, the output will be this:
You can already feel that the editor is very basic, right?! 😃
In Emacs style editors you don’t need an insertion command, just start typing and the text already appears in the file!
em [file-name]
- Opens the file indicated in [file-name]
, example: em main.cpp
;Alt + z
- Save and exit;Ctrl + x d
(quickly type x and then d) - Quit without saving if you press y to the question: Modified buffers exist. Leave anyway (y/n)?
;And among several other commands you can consult on the MicroEmacs Wiki that also work for uEmacs.
Remembering that
^X
means Ctrl + x andM
means Alt .
To the next!