Re: [code] [textadept] [feature request] Distraction free mode

From: Mitchell <>
Date: Mon, 4 Mar 2013 15:22:48 -0500 (Eastern Standard Time)

Hi Klaus,

On Sat, 2 Mar 2013, Klaus Borges wrote:

> Hello,
> This might seem like a useless feature to some, so I'm okay if it isn't
> feasible.
> A few editors (nowadays? I'm not really sure if it's a trend) come with a
> distraction free mode, which basically makes the application full-screen
> and without title and status bars, line numbers and etc. It just gives you
> a "blank" page to write on. I find it pretty useful for writing and coding,
> even though when every once in a while you have to Google something.
> TextAdept has been my main text editor for almost a year now, however when
> writing I seem to prefer anything with a distraction free mode because it
> certainly makes me more productive, maybe even more creative.

This is as close as you can get:

-- Add this to your ~/.textadept/init.lua
local distraction_free = false
local margin_widths = {}
local update_ui_hook
keys.cf11 = function()
   local buffer = buffer
   if not distraction_free then{}
     for i = 0, 4 do
       margin_widths[i] = buffer.margin_width_n[i]
       buffer.margin_width_n[i] = 0
     buffer.h_scroll_bar, buffer.v_scroll_bar = false, false
     update_ui_hook = events.connect(events.UPDATE_UI, function()
       gui.statusbar_text, gui.docstatusbar_text = '', ''
     for i = 0, 4 do
       buffer.margin_width_n[i] = margin_widths[i]
     buffer.h_scroll_bar, buffer.v_scroll_bar = true, true
   distraction_free = not distraction_free

You will have to manually maximize your window via the window manager
though. Pressing "Ctrl+F11" will toggle the mode.

Notice the statusbars are not hidden; they're just empty all the time. I
don't know how useful it would be to add the ability to hide them usin


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Mon 04 Mar 2013 - 15:22:48 EST

This archive was generated by hypermail 2.2.0 : Tue 05 Mar 2013 - 06:44:26 EST