retab is a simple Micro plugin for toggling indentation between tabs and spaces.
It automatically uses the buffer's tabsize and works in both directions: spaces → tabs and tabs → spaces.
Displays a brief info message in Micro's InfoBar after conversion.
Compatible with Micro >= 2.0.0.
Author: Kamil BuriXon Burek, Version: 1.0.0.
This plugin is useful for developers who want a quick and reliable way to normalize indentation.
It’s a small, fast, and handy alternative to manually adjusting tabs or spaces.
- Make sure you have Micro >= 2.0.0 installed (command
micro --version). - Navigate to the Micro plugins directory:
mkdir -p ~/.config/micro/plug
cd ~/.config/micro/plug
- Download the plugin:
wget https://raw.githubusercontent.com/BuriXon-code/micro-retab-plugin/main/retab.lua
- Restart Micro to load the plugin.
- Navigate to the Micro plugins directory:
mkdir -p ~/.config/micro/plug
cd ~/.config/micro/plug
- Clone the repository:
git clone https://github.com/BuriXon-code/micro-retab-plugin.git
- Restart Micro.
- Debian/Ubuntu/Termux (pkg/apt): make sure
microis installed viaapt install microorpkg install micro. - Arch Linux/Manjaro (pacman):
sudo pacman -S micro. - Fedora/RHEL (dnf):
sudo dnf install micro. - Alpine (apk):
sudo apk add micro.
In Micro (Ctrl+E), simply type:
retab
This will convert leading spaces to tabs or leading tabs to spaces according to your buffer tabsize.
After completion, a short message appears in Micro's InfoBar indicating what conversion was performed.
For any issues, suggestions, or questions, reach out via:
- Email: support@burixon.dev
- Contact form: Click here
- Bug reports: Click here
If you find this script useful, consider supporting my work by making a donation:
Your contributions help in developing new projects and improving existing tools!
