# Tmux Keybinding Conventions
## Rule
All custom tmux keybindings MUST be ergonomic, consistent, and preserve the current working directory for splits and new windows.
## Required Bindings
### Splits Must Preserve Path
```bash
# Good: preserves current directory
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Bad: opens in home directory
bind | split-window -h
bind - split-window -v
```
### Pane Navigation (Vi-Style)
```bash
# Good: consistent with Vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Better: with vim-tmux-navigator (seamless Vim/tmux)
set -g @plugin 'christoomey/vim-tmux-navigator'
```
### Pane Resizing
```bash
# Good: uppercase = resize, repeatable
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
```
### Config Reload
```bash
# Good: instant feedback
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
```
## Mnemonic Keys
| Binding | Mnemonic | Action |
|---------|----------|--------|
| `|` | Visual pipe | Vertical split |
| `-` | Visual dash | Horizontal split |
| `h/j/k/l` | Vi motions | Pane navigation |
| `r` | Reload | Source tmux.conf |
| `z` | Zoom | Toggle pane zoom |
## Good
```bash
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
```
## Bad
```bash
# Default % and " are not mnemonic
bind % split-window -h # What does % mean for horizontal?
bind '"' split-window -v # Confusing
```