TextAdept is fun to use and hack – Part 1

I am a happy SublimeText customer. I am really happy with it. It’s an awesome text editor with great community and plugins. But it’s not a FOSS. I was always in look out for a simple but extendable, customizable, super fast text editor. Recently when I picked up Lua to learn I chanced upon TextAdept. Its everything I wanted though it lacks the community that other editors have. May be its just matter of time.

By definition Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor. Even though TextAdept is composed of various technologies at the heart its Scintilla with Lua as its main scripting language. All in all its 2000 lines of C code and less than 4000 lines of Lua code.

textadept

I have customized TextAdept to my heart’s content. I still do a bit every day. In this blog series I will try to note what I find interesting about TextAdept and what customizations I did.

Bootup
All the settings, themes, modules are stored inside the .textadept folder inside user’s home folder. When the TextAdept boots it loads ~/.textadept/init.lua. You can include all your customizations in your init.lua or you call other scripts from there.

Theming
Textadept customize its look and feel, using themes. Themes are just Lua scripts. Theme files usually live inside ~/.textadept/themes folder. You can load a specific theme from your init.lua file.

Considering you a theme file called inside

~/.textadept/themes/base16-monokai-dark.lua

You can include the following lines inside init.lua

ui.set_theme(not CURSES and 'base16-monokai-dark')

TextAdept comes with two themes by default. A dark and light theme. But I use base16 based themes. There is a git repository of TextAdept base16 based themes. Just clone it into you ~/.textadept/themes folder and then include the theme you want. I have made some changes to monokai theme. You can find it on Gist if you like use it.

As part of themes you can change many other things. For example by using the following settings you can set

buffer.view_ws            = buffer.WS_VISIBLEALWAYS
buffer.use_tabs           = true
buffer.wrap_visual_flags  = buffer.WRAPVISUALFLAGLOC_START_BY_TEXT
buffer.wrap_mode          = buffer.WRAP_WHITESPACE

Make the white space always visible. Wrap the text lines and use a character to show the wrapped line. It shows up like in the picture below.
wrap

You can obviously change the font for the code. I really love Anonymous Pro. It’s designed with coding in mind. Its clean, clear and beautiful. It’s also available under Open Font License (OFL). In the screenshots above you can see how Anonymous Pro looks.

You may also like...

2 Responses

  1. March 1, 2015

    […] @textadept: TextAdept is fun to use and hack – Part 1 thejeshgn.com/2015/02/28/tex… by […]

  2. March 5, 2015

    […] @fx86 its extend-ability with Lua as the scripting lang. Planning to write a series of posts starting with thejeshgn.com/2015/02/28/tex… […]

Leave a Reply

Your email address will not be published. Required fields are marked *