Short function of the week

From: Brian Schott <>
Date: Sun, 17 Jul 2011 22:11:24 -0700

(Just pretend this was posted on Saturday)

This function automatically wraps text as you type it at the edge_column value from your theme file, if it's been set. Useful for just keeping notes in plain text files.

keys[' '] = function()
        if buffer:get_lexer() == "container" then
                local buffer = buffer
                if buffer.column[buffer.current_pos] < buffer.edge_column then return false end
                while buffer.column[buffer.current_pos] > buffer.edge_column do buffer:word_left() end
                buffer:add_text(" ")
        else return false end
Received on Mon 18 Jul 2011 - 01:11:24 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:14:14 EST