Module textredux.buffer_list

The buffer list module provides a text based replacement for the standard Textadept buffer list.

Usage

Use the textredux.hijack function or load the buffer list in your ~/.textadept/init.lua:

local textredux = require('textredux')
keys["ctrl+b"] = textredux.buffer_list.show

Features

Functions

currently_selected_buffer (list) Returns the currently selected buffer in the list.
close_buffer (list) Closes the currently selected buffer in the buffer list.
close_selected (list) Closes all currently selected/filtered files in the buffer list.
show (buffers) Shows a list of the specified buffers, or _G.BUFFERS if not specified.

Tables

keys The key bindings for the buffer list.

Fields

list The Textredux list instance used by the buffer list.


Functions

currently_selected_buffer (list)
Returns the currently selected buffer in the list.

Parameters:

  • list The Textredux list instance used by the buffer list. If not provided, then the global list is used automatically.

Returns:

  1. The currently selected buffer, if any.
  2. The currently selected buffer's name, if any.
close_buffer (list)
Closes the currently selected buffer in the buffer list.

Parameters:

  • list The Textredux list instance used by the buffer list. This function is ordinarily invoked as the result of a key binding, and you should thus not need to specify this yourself. If list isn't provided, the global list is automatically used.
close_selected (list)
Closes all currently selected/filtered files in the buffer list.

Parameters:

  • list The Textredux list instance used by the buffer list. This function is ordinarily invoked as the result of a key binding, and you should thus not need to specify this yourself. If list isn't provided, the global list is automatically used.
show (buffers)
Shows a list of the specified buffers, or _G.BUFFERS if not specified.

Parameters:

  • buffers Either nil, in which case all buffers within _G.BUFFERS are displayed, or a function returning a table of buffers to display.

Tables

keys
The key bindings for the buffer list.

You can modifiy this to customise the key bindings to your liking. The key bindings are passed directly to the Textredux list, so note that the first argument to any function will be the Textredux list itself. You can read more about the Textredux list's keys in the list documentation.

If you like to add a custom key binding for closing a buffer or all buffers in the current selection you can bind the close_buffer and close_selected functions to a key of your choice. For other actions it's likely that you want to obtain the currently selected buffer - you can use the currently_selected_buffer function for that.

Fields:

  • [ctrl+d] Default for close buffer
  • [CURSES]

Fields

list
The Textredux list instance used by the buffer list.