Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bindings): Avoid clobbering readline #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ tmux

# Shortcuts

* `Ctrl + a, Ctrl + c` or `Ctrl + t`: create a new window
* `Ctrl + a, Ctrl + s`: create a new nested tmux session and ask a name for it
* `Ctrl + a, Ctrl + A`: switch to last window
* `Ctrl + a, A`: rename current window
* `Ctrl + z, Ctrl + c` or `Ctrl + t`: create a new window
* `Ctrl + z, Ctrl + s`: create a new nested tmux session and ask a name for it
* `Ctrl + z, Ctrl + A`: switch to last window
* `Ctrl + z, A`: rename current window
* `Alt + Right`: move to the next window of the current row
* `Alt + Left`: move to the previous window of the current row
* `Alt + Up`: move to the inner tmux session
Expand Down
19 changes: 10 additions & 9 deletions active-row.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,28 @@ set -g history-limit 100000
# Configure prefix
#
unbind C-b
set -g prefix C-a
# Avoid clobbering common readline bindings which should be very fast, whereas
# backgrounding a process is relatively incommon and the double-prefix is fine.
set -g prefix C-z
# Pass the prefix through (Ctrl + z, Ctrl + z)
bind C-z send-prefix

#
# Prefixed commands
#

# Create a new window (Ctrl + A, Ctrl + c)
# Create a new window (Ctrl + z, Ctrl + c)
bind C-c new-window

# Create a new nested tmux (Ctrl + A, Ctrl + s)
# Create a new nested tmux (Ctrl + z, Ctrl + s)
bind C-s new-window ~/.tmux.conf.d/nested-tmux/new-tmux \; \
rename-window '' \; \
command-prompt -I "#W" "rename-window -- '%%'"

# Switch to last window (Ctrl + A, Ctrl + A)
bind C-a last-window
# Switch to last window (Ctrl + z, Ctrl + e)
bind C-e last-window

# Rename current window (Ctrl + A, A)
# Rename current window (Ctrl + z, A)
bind A rename-window '' \; \
command-prompt -I "#W" "rename-window -- '%%'"

Expand All @@ -52,9 +56,6 @@ bind -n M-right next
# Go to previous window (Alt + Left)
bind -n M-left prev

# Create new window (Ctrl + t)
bind -n C-t new-window

# Switch to inner tmux (Alt + Up)
bind -n M-up send-keys M-F12

Expand Down
2 changes: 1 addition & 1 deletion inactive-row.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
setw -g window-status-current-style bg=$inactive_window_bg

# Unbind prefix
set -u -g prefix C-a
set -u -g prefix C-z

# Unbind each unprefixed command
unbind -n M-left
Expand Down