Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christopher-francisco/tmux-status.nvim
Get tmux status components for your statusline
https://github.com/christopher-francisco/tmux-status.nvim
Last synced: about 2 months ago
JSON representation
Get tmux status components for your statusline
- Host: GitHub
- URL: https://github.com/christopher-francisco/tmux-status.nvim
- Owner: christopher-francisco
- License: mit
- Created: 2024-07-25T21:00:56.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T23:23:53.000Z (2 months ago)
- Last Synced: 2024-07-27T00:38:19.217Z (2 months ago)
- Language: Lua
- Size: 28.3 KB
- Stars: 20
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💎 tmux-status.nvim
![code size](https://img.shields.io/github/languages/code-size/christopher-francisco/tmux-status.nvim?style=flat-square)
![license](https://img.shields.io/github/license/christopher-francisco/tmux-status.nvim?style=flat-square)Keep your setup clean by having only 1 status bar.
https://github.com/user-attachments/assets/65e9026f-ecda-456e-a894-cbac4f919a83
## ✨ Features
* 🛠️ Integrate Tmux status directly into your Neovim statusline (i.e: [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim))
* 👀 Automatically hide/show Tmux status so that there's only ever 1 line
* 📍 Both Neovim and Tmux command line in the same location (tell them apart through color)
* 🌐 Component-based design for flexibility and portability
* 🎨 Customize colors
* 🖼️ Customize Tmux status windows flag with your favorite icons## ⚡️ Requirements
* Neovim >= 0.9.5
* Tmux >= 3.2
* (Optional) a [Nerd Font](https://www.nerdfonts.com/) for icons in components, such as the Tmux status window flags## 📦 Installation
### [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
"christopher-francisco/tmux-status.nvim",
lazy = true,
opts = {},
},
```## 🖋️ Usage
Just call the component function: `require('tmux-status').tmux_windows()`
### [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim)
```lua
local opts = {
sections = {
lualine_c = {
-- ...other lualine components
{
require('tmux-status').tmux_windows,
cond = require('tmux-status').show,
padding = { left = 3 },
},
},
lualine_z = {
-- ...other lualine components
{
require('tmux-status').tmux_session,
cond = require('tmux-status').show,
padding = { left = 3 },
},
}
}
}
```## 🧩 Components
| Component | Description |
| --- | --- |
| `require('tmux-status').tmux_windows()` | Returns Tmux windows with their highlight groups (active, recently inactive, inactive) and the icon corresponding to their window flags |
| `require('tmux-status').tmux_session()` | Returns Tmux session name with its highlight group |
| `require('tmux-status').tmux_datetime()` | Returns the datetime (see `man date`) with its highlight group |
| `require('tmux-status').tmux_battery()` | Returns the battery (requires `pmset`, may not be availabe in all OS) with its highlight group |
| `require('tmux-status').tmux_render_format(format)` | Advanced component for those who want extra control. Requires familiarity with Tmux configurations. See [Advance usage](#advance-usage) |## ⚙️ Configuration
Default Options
```lua
---@type TmuxStatusOptions
local defaults = {
window = {
separator = " ",
icon_zoom = "",
icon_mark = "",
icon_bell = "",
icon_mute = "",
icon_activity = "",
text = "dir",
},
session = {
icon = ""
},
datetime = {
icon = "",
format = "%a %d %b %k:%m",
},
battery = {
icon = "",
},
colors = {
window_active = "#e69875",
window_inactive = "#859289",
window_inactive_recent = "#3f5865",
session = "#a7c080",
datetime = "#7a8478",
battery = "#7a8478",
},
force_show = false, -- Force components to be shown regardless of Tmux status
manage_tmux_status = true, -- Set to false if you do NOT want the plugin to turn Tmux status on/off
}
```## Advance usage
Advanced components for those who want extra control. Must be familiar with Tmux config. Renders a format. See FORMATS in tmux manual.
```lua
local lualine_x = {
{
function ()
local text = '%#my_custom_highlight_title# Catppuccin: %#my_custom_highlight_description#'
return text .. require('tmux-status').tmux_render_format('@catppuccin_flavour')
end,
cond = require('tmux-status').show,
},
}
```