https://github.com/graemedavidson/tmux-pane-focus
Tmux plugin to auto resize windows on focus similar to NVim Focus: https://github.com/beauwilliams/focus.nvim
https://github.com/graemedavidson/tmux-pane-focus
tmux tmux-plugins
Last synced: 22 days ago
JSON representation
Tmux plugin to auto resize windows on focus similar to NVim Focus: https://github.com/beauwilliams/focus.nvim
- Host: GitHub
- URL: https://github.com/graemedavidson/tmux-pane-focus
- Owner: graemedavidson
- License: mit
- Created: 2023-03-17T11:02:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-09T13:19:04.000Z (7 months ago)
- Last Synced: 2025-05-09T14:32:47.575Z (7 months ago)
- Topics: tmux, tmux-plugins
- Language: Shell
- Homepage:
- Size: 294 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tmux - tmux-pane-focus - Resizing splits to improve readability. (Plugins)
README
# tmux pane focus
[](https://codecov.io/gh/graemedavidson/tmux-pane-focus)
Tmux plugin to auto resize panes on focus similar to [nvim Focus](https://github.com/beauwilliams/focus.nvim).
Utilises [tmux hooks](./docs/tmux.md#hooks) to react to the creation and selection of panes.
- Size: >=50, <100.
- Direction:
- `+`: both
- `|`: width changes only
- `-`: height changes only
Plugin still in an alpha stage. Currently testing locally to confirm features and find bugs. A refactor is coming as
currently not in a DRY state with a lack of naming clarity and commenting hindering contributing. Feel free to use
though and open an issue or start a discussion.
## Installation
### Tmux Plugin Manager
Add plugin GitHub url to list of tpm plugins. Specify tag/branch for specific version.
```
set -g @plugin 'graemedavidson/tmux-pane-focus'
# set -g @plugin 'graemedavidson/tmux-pane-focus#tag'
```
### Manual
Clone repo into tmux plugins dir.
Add run shell command to end of `.tmux.conf` file to activate plugin.
```conf
run-shell '~/.tmux/plugins/tmux-pane-focus/focus.tmux'
```
## Configuration
Changes to configuration require a tmux config reload or new tmux session to pickup changes. Adding the following
configuration can simply the process for testing which also requires a restart to start using.
```bash
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
```
Enable/Disable plugin:
```
set -g @pane-focus-enabled on
```
Add configuration to the `.tmux.conf` file to override the following defaults:
- focus size: `50%`
- focus direction: `+`
```conf
set -g @pane-focus-size '50'
set -g @pane-focus-direction '+'
```
### Settings Menu
The default and global settings can be overridden at the window level through an options menu.
tmux shortcut: `ctrl-a T`.
### Status bar
Add current active size and direction to status bar:
```conf
set -g status-right '#[fg=colour255,bg=colour237][#{@pane-focus-direction}][#{@pane-focus-size}]#[fg=default,bg=default]'
```