Paste Reindent


Note: This feature will appear in Textadept 10.7 as textadept.editing.paste_reindent().

The paste_reindent module defines a command that reindents pasted text according to the surrounding context and local indentation settings.

When copy-pasting code from an external resource, or just when refactoring your own code, simply pasting it may result in your needing to manually change or adjust indentation. This can be often tedious, so this module is here to help.


After downloading the linked module and saving it to a *~/.textadept/modules/paste_reindent/* directory, put the following in your ~/.textadept/init.lua:


You can also define a key binding for it in the process:

-- Ctrl+Shift+V paste reindents
keys.cV = require('paste_reindent')

The command is also available in the Edit menu as "Paste Reindent"

Edited on Saturday, September 21st 2019 at 1:23 PM.