A lightweight plugin that enriches the Micro editor status bar with useful system and project information.
- Left side – Shell type, filetype, and current filename (with Nerd Font icons).
- Right side – Git branch & status, cursor position, battery percentage, and current time.
Replaces the default keybinding hints and empty space with clean, glanceable data.
- 🐚 Detects parent shell (bash, zsh, fish, nu, etc.) and displays an icon
- 📄 Shows current filetype with matching Nerd Font icon
- 📁 Displays the base filename (truncated path)
- 🌱 Git branch name with dirty state indicators (
+untracked,!modified,✘deleted,✓clean) - 📍 Cursor position (
line:col) - 🔋 Battery percentage with charging/full/low icons (reads from
/sys/class/power_supply/BAT*/) - 🕒 Current time in 24‑hour format (
HH:MM)
Updates automatically on buffer changes, cursor movement, saves, and every second (for time/battery).
Once published, install directly inside Micro:
- Open Micro
- Press
Ctrl+eto open the command prompt - Type:
> plugin install smartstatus - Press Enter
Clone this repository into Micro's plugin directory:
git clone https://github.com/sycorlax/micro-smartstatus.git ~/.config/micro/plug/smartstatusThen restart Micro or run > plugin reload smartstatus.
The plugin uses Micro’s built‑in statusformatl and statusformatr options to control the left and right sides.
Add or modify the following lines in your ~/.config/micro/settings.json:
{
"statusformatl": "$(smartstatus.updateLeft)",
"statusformatr": "$(smartstatus.smartInfo)"
}statusformatl– calls the plugin’s left‑side formatter (shell, filetype, filename)statusformatr– calls the right‑side formatter (git, cursor, battery, time)
Note: The plugin automatically sets
statusformatlwhen it loads, but including it in your config ensures it persists across sessions.
If your system uses a different battery name (e.g., BAT0 instead of BAT1), edit smartstatus.lua and modify the list inside getBattery():
for _, bat in ipairs({"BAT0", "BAT1"}) doEdit the smartInfo() function in smartstatus.lua:
table.insert(parts, "" .. os.date("%H:%M")) -- change to "%I:%M %p" for 12‑hourAll icons are defined in the SHELL_ICONS and FT_ICONS tables at the top of smartstatus.lua.
You can replace them with your preferred Nerd Font glyphs or plain text.
The timer runs every second by default. Adjust the 1000 value in startRefreshTimer() (milliseconds).
-
Left side shows nothing?
Ensuresettings.jsoncontains"statusformatl": "$(smartstatus.updateLeft)"and that you have a Nerd Font installed (icons may appear as boxes otherwise). -
Right side empty or missing Git branch?
Verify"statusformatr": "$(smartstatus.smartInfo)"is present and that you are inside a Git repository with thegitcommand available. -
Battery shows
?or nothing?
Check that your battery path is correct (see Customization). Try runningcat /sys/class/power_supply/BAT1/capacityin a terminal. -
Icons appear as squares or unknown characters?
Install a Nerd Font and configure your terminal to use it.
MIT License – feel free to use, modify, and share.
This updated README now matches the plugin’s actual behavior and provides complete configuration instructions.
