Lued

What is it?

Lued is a text editor that runs in the console like emacs and vim. The goal is to be comfortable for Windows users. Common Windows keystrokes are supported. For example, Ctrl+C, Ctrl+X, Ctrl+V do copy, cut and paste, respectively. Ctrl+Z and Ctrl+Y undo and redo. Ctrl+S, Ctrl+Q save and quit. You move arrow using the arrow keys. PgUp, PgDn, Home and End work as expected. For more advanced commands, Lued attempts to be similar to Sublime or VScode. You can use the mouse to copy and paste and the scroll wheel lets you easily navigate up and down the document.

Lued is compatible with most xterms such as Konsole and Gnome Terminal. It also works well with PuTTy and tmux.

Get it

Lued source code is available under the MIT License at github.com/jwrr/lued. You can download a zip file or clone the repo.

git clone https://github.com/jwrr/lued

Build it

To build Lued just run the COMPILE script. The script handles downloading Lua 5.2, applying a few minor patches to the Lua release, running cmake and compiling lued.

You will need cmake. On Ubuntu you can install with apt-get.

sudo apt-get -y install cmake

Try it

> ./lued filename.txt

Use it

You’ve gotten this far and you haven’t turned away. You want to know more. Lued offers many ways to move, select, find and delete. I recommend you first take a quick look at the key bindings. And then dive into the User Guide.

Tweak it

You can easily change the key bindings. The key bindings are defined in file lua_src/bindings/lued_bindings.lua. The bindings have the format alt_xxx and ctrl_yyy (these are actually lua function calls but don’t worry about that). To change a binding, just find it and replace it with what you want. For example, say you want to change the replace to end-of-line command from alt+XE to ctrl+K, as it is in Emacs. You would open the lued_bindings.lua file (using lued or your editor of choice), find ‘alt_xe’, ctrl+F and change it to ‘ctrl_K’. Now restart lued and you’re good to go. BTW, Ctrl+K is not currently used, and is waiting for you to make this change.

Extend it

All commands are implemented in Lua (there’s some C under the hood but you’ll never see it… unless you want to). Lua is an easy to learn scripting language that is powerful and blazingly fast. You can modify the Lua code directly or you can develop a plugin (also written in Lua). The plugins support emmet snippets where you type a user-defined tag followed by Tab and a pre-defined template is printed out.

Fix it

Submit your pull requests. Thanks


Other JWRR projects

  • carr - C arrays. Support for large, dynamic arrays. Lued uses this library as it’s main data store.
  • efefomatic - Flat File web page cms. The main JWRR site is implemented using efefomatic. It’s not much to look at, but it’s mine.
  • vhdl examples - Example VHDL files. If you’re interested in FPGAs and ASICs take a look. I also have a Verilog tutorial.
  • My Gists - it’s easier to post here than on Github’s gits site

Posts

subscribe via RSS