Skip to content

Commit

Permalink
Merge pull request #38 from graemedavidson/resize-pane-on-new-panel
Browse files Browse the repository at this point in the history
resize pane on creation of new pane.
  • Loading branch information
graemedavidson authored Mar 5, 2024
2 parents 6e0ceee + 1ab22f2 commit 94adfd6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
https://keepachangelog.com/en/1.0.0/

## [v0.4.0-alpha] - 05/03/24
**Unreleased**

### Added

- hook to resize when creating new panes within a window.

### Fixed

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[![codecov](https://codecov.io/gh/graemedavidson/tmux-pane-focus/branch/main/graph/badge.svg?token=2ULOAGT6BT)](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).
On focusing on another pane the hook `after-select-pane` calls the focus script.

Utilises [tmux hooks](./docs/tmux.md#hooks) to react to the creation and selection of panes.

- Size: >=50, <100.
- Direction:
Expand Down
10 changes: 10 additions & 0 deletions docs/tmux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Tmux

## Hooks

Pane Focus utilises a tmux hook to activate the script. List available hooks for session, window, and pane. The list
includes hooks currently configured.

```bash
tmux show-hooks -s # show all hooks available for the session.
```
1 change: 1 addition & 0 deletions focus.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

tmux set-hook -g after-select-pane "run-shell '$CURRENT_DIR/scripts/focus.sh'"
tmux set-hook -g after-split-window "run-shell '$CURRENT_DIR/scripts/focus.sh'"

tmux bind-key T run-shell "$CURRENT_DIR/scripts/menu.sh"

0 comments on commit 94adfd6

Please sign in to comment.