Sunday, May 6, 2018

How to build Textadept from Source

Textadept - a lightweight text editor - how to compile
There are loads of text editors out there. But if you want a lightweight texteditor that is extendable up to your keystrokes, you want Textadept. Today we see how to compile it from source and extend even more.


A little background about Textadept - Textadept is a scintilla based text editor, which is designed to be fast, lightweight and extensible. The main C code is within 2000 lines and they are strong to keep it that way. The other functionality can be extended with lua scripting language.

Compiling/building from source is easy. Just download, cd to src, make deps, make, make install. We are going to look into details below (for Linux).

In case official documentation needed for building, it is available here. The page also has instructions for platforms other than Linux.




Step 1: Download source

From here - stable:
https://github.com/rgieseke/textadept/archive/textadept_10.0.zip
* Currently 10.0 is stable. If any other version is released, you can find here.
* This is not official source but it is convenient to get from here rather than confusing official website.

Or from here - latest beta/development version:
https://foicica.com/hg/textadept/archive/tip.zip

after extract it, we assume it will be in textadeptxyz

Step 2: Installing dependencies

These are just needed to build. But after install, nearly no dependency is needed by Textadept, except gtk2 and maybe lua. It is built with extremely low dependency in mind.

on Ubuntu/Debian:
sudo apt install automake gettext libtool clang libgtk2.0-dev
If build fails, you may also need to install:
sudo apt install darcs wget unzip

on Arch Linux:
sudo pacman -S autoconf automake gettext libtool clang gtk2 darcs wget unzip

Step 3: Build baby, build!

Just open terminal and do:

cd textadeptxyz/src
make deps
make
sudo make install

If you need to see how sample output should look like...

Output of make deps : https://ghostbin.com/paste/pbckm
Output of make : https://ghostbin.com/paste/9h6w9
Output of make install : https://ghostbin.com/paste/q796y

If you need more help on the make command, this table is your friend:

Textadept make command options table for compiling

Update: The article was originally written for version 9.6. Version 10.0 has been release recently (I have updated the download link accordingly). The new version gives me "cannot open /usr/local/share/textadept/core/init.lua: Permission denied" error when running. I fixed it with: sudo chmod -R 755 /usr/local/share/textadept/core && sudo chmod -R 755 /usr/local/share/textadept/modules

Now that you know how to compile Textadept, you can try many other projects like this one, which adds many new functionalities to Textadept. They have guides on how to modify the source code and get these features fully integrated into Textadept.

Hope you have a wonderful time with this great lightweight text editor.

No comments:

Post a Comment