change README mappings to table, improve <,> + join as split + tweaks

This commit is contained in:
Kevin MacMartin 2014-10-28 10:34:03 -04:00
parent a5f1e48667
commit e16d7ede0b
3 changed files with 61 additions and 59 deletions

View file

@ -17,27 +17,29 @@
## Key Bindings ## ## Key Bindings ##
* **Prefix**: `Ctrl-Space` * **Prefix**: `<Ctrl><Space>`
* `m` and `Ctrl-m`: Toggle mouse mode on and off respectively.
* `\` and `Ctrl-\`: Toggle the status bar on and off respectively. | Key(s) | Behaviour |
* `c` and `Ctrl-c`: Create a new pane and create a new pane in the current directory respectively. |-----------------------------------------|----------------------------------------------------------------------------------------|
* `[` and `]`: Split the window vertically and horizontally respectively. | `<Backslash>` and `<Ctrl><Backslash>` | Toggle the status bar on and off respectively |
* `{` and `}`: Rotate the window up and down respectively. | `c` and `<Ctrl>c` | Create a new pane and create a new pane in the current directory respectively |
* `=` and `-`: Select an even layout horizontally and vertically respectively. | `_` and `+` | Join a window as a split pane top/bottom and left/right respectively (leave pane: `!`) |
* `+` and `_`: Select a main layout horizontally and vertically respectively. | `[` and `]` | Split the window vertically and horizontally respectively |
* `<` and `>`: Swap the current window with the first and last window respectively. | `{` and `}` | Rotate the window up and down respectively |
* `.` and `,`: Move and swap the current window with the provided window number respectively. | `=` and `-` | Select an even layout horizontally and vertically respectively |
* `$` and `#`: Rename the current session and window with the provided name respectively. | `<` and `>` | Move the current window to the first and last window respectively |
* `Space` and `Ctrl-Space`: Move to the previously selected window and pane respectively. | `.` and `,` | Move and swap the current window with the provided window number respectively |
* `h`, `j`, `k` and `l`: Move left, down, up and right between panes respectively like the arrow keys. | `$` and `#` | Rename the current session and window with the provided name respectively |
* `` ` ``: Toggle synchronized input between the panes on the current window. | `<Space>` and `<Ctrl><Space>` | Move to the previously selected window and pane respectively |
* `Escape`: Clear the terminal history, tmux history and the current window/pane. | `h`, `j`, `k` and `l` | Move left, down, up and right between panes respectively like the arrow keys |
* `?` and `/`: Show help for available key bindings and commands respectively. | `` ` `` | Toggle synchronized input between the panes on the current window |
* `y` and `Ctrl-p`: Enter __copy mode__ and paste from the copy buffer respectively. | `<Escape>` | Clear the terminal history, tmux history and the current window/pane |
* `Ctrl-v` and `Ctrl-y`: Pastes the X buffer in tmux, and sends the tmux buffer to X respectively. | `?` and `/` | Show help for available key bindings and commands respectively |
* (**copy mode**) `v`, `y` and `Escape`: Begin selection, copy selection and cancel **copy mode** respectively. | `y` and `<Ctrl>p` | Enter __copy mode__ and paste from the copy buffer respectively |
* `Alt-[0-9]` (no prefix): Switch directly to the given window. | `<Ctrl>v` and `<Ctrl>y` | Pastes the X buffer in tmux, and sends the tmux buffer to X respectively |
* `W`: Write scrollback buffer to file. | (**copy mode**) `v`, `y` and `<Escape>` | Begin selection, copy selection and cancel **copy mode** respectively |
| `Alt-[0-9]` (no prefix) | Switch directly to the given window |
| `W` | Write scrollback buffer to file |
## Italics Support ## ## Italics Support ##

View file

@ -49,25 +49,29 @@ set-option -g mouse-select-window on
# KEY BINDINGS # KEY BINDINGS
# #
# m and ctrl-m to enabling and disabling the mouse respectively # m and <ctrl>m to enabling and disabling the mouse respectively
bind m set-option -g mode-mouse on \; set-option -g mouse-resize-pane on \; set-option -g mouse-select-pane on \; set-option -g mouse-select-window on \; display 'Mouse: ON' bind m set-option -g mode-mouse on \; set-option -g mouse-resize-pane on \; set-option -g mouse-select-pane on \; set-option -g mouse-select-window on \; display 'Mouse: ON'
bind C-m set-option -g mode-mouse off \; set-option -g mouse-resize-pane off \; set-option -g mouse-select-pane off \; set-option -g mouse-select-window off \; display 'Mouse: OFF' bind C-m set-option -g mode-mouse off \; set-option -g mouse-resize-pane off \; set-option -g mouse-select-pane off \; set-option -g mouse-select-window off \; display 'Mouse: OFF'
# #
# r and ctrl-r to reloading ~/.tmux.conf and /etc/tmux.conf respectively # r and <ctrl>r to reloading ~/.tmux.conf and /etc/tmux.conf respectively
bind r source-file ~/.tmux.conf bind r source-file ~/.tmux.conf
bind C-r source-file /etc/tmux.conf bind C-r source-file /etc/tmux.conf
# #
# \ and ctrl-\ to enabling and disabling the status bar respectively # \ and <ctrl>\ to enabling and disabling the status bar respectively
bind \ set-option -g status on bind \ set-option -g status on
bind C-\ set-option -g status off bind C-\ set-option -g status off
# #
# c and ctrl-c to create a new pane in the current path and in home respectively # c and <ctrl>c to create a new pane in the current path and in home respectively
bind C-c new-window -c '#{pane_current_path}' bind C-c new-window -c "#{pane_current_path}"
bind c new-window bind c new-window
# #
# [ and ] to splitting the window into top/bottom and left/right respectively # [ and ] to splitting the window into top/bottom and left/right respectively
bind [ split-window -v -c '#{pane_current_path}' bind [ split-window -v -c "#{pane_current_path}"
bind ] split-window -h -c '#{pane_current_path}' bind ] split-window -h -c "#{pane_current_path}"
#
# <ctrl>[ and <ctrl>] join another window as a pane split top/bottom and left/right respectively
bind _ choose-window 'join-pane -v -s "%%"'
bind + choose-window 'join-pane -h -s "%%"'
# #
# { and } to rotating up and down respectively # { and } to rotating up and down respectively
bind -r { rotate-window -U bind -r { rotate-window -U
@ -77,13 +81,9 @@ bind -r } rotate-window -D
bind = select-layout even-horizontal bind = select-layout even-horizontal
bind - select-layout even-vertical bind - select-layout even-vertical
# #
# + and _ to vertically/horizontally laying out the panes with one large one on the top/left respectively # < and > to move the current window to the first and last windows respectively
bind + select-layout main-horizontal bind < run-shell "while [[ ! $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') = 1 ]]; do tmux swap-window -s $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') -t $(expr $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') - 1); done"
bind _ select-layout main-vertical bind > run-shell "while [[ ! $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') = $(tmux list-windows | tail -n 1 | sed 's|:.*$||') ]]; do tmux swap-window -s $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') -t $(expr $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') + 1); done"
#
# < and > to swap the current window with the first and last windows respectively
bind < swap-window -t '1'
bind > run-shell "tmux swap-window -s $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') -t $(tmux list-windows | tail -n 1 | sed 's|:.*$||')"
# #
# . and , to move and swap the current window respectively (. is set by default) # . and , to move and swap the current window respectively (. is set by default)
bind , command-prompt "swap-window -t '%%'" bind , command-prompt "swap-window -t '%%'"
@ -91,7 +91,7 @@ bind , command-prompt "swap-window -t '%%'"
# $ and # to rename the session and current window respectively ($ is set by default) # $ and # to rename the session and current window respectively ($ is set by default)
bind "#" command-prompt -I '#W' "rename-window '%%'" bind "#" command-prompt -I '#W' "rename-window '%%'"
# #
# Space and ctrl-Space to navigating to the previously selected pane and window respectively # Space and <ctrl>Space to navigating to the previously selected pane and window respectively
bind Space last-pane bind Space last-pane
bind C-Space last-window bind C-Space last-window
# #
@ -108,16 +108,16 @@ bind k select-pane -U
bind l select-pane -R bind l select-pane -R
# #
# ~ to synchronous panes # ~ to synchronous panes
bind ` set-window-option synchronize-panes \; display 'Toggling pane synchronization' bind ` set-window-option synchronize-panes \; display "synchronize-panes: toggled"
# #
# escape to clearing history and screen # escape to clearing history and screen
bind Escape send-keys -R\; send-keys 'C-l'\; clear-history bind Escape send-keys -R\; send-keys 'C-l'\; clear-history
# #
# ? and ctrl-? to keyboard and command help respectively # ? and <ctrl>? to keyboard and command help respectively
bind ? list-keys bind ? list-keys
bind / list-commands bind / list-commands
# #
# y and ctrl-p to copy mode and pasting the copy buffer respectively # y and <ctrl>p to copy mode and pasting the copy buffer respectively
bind y copy-mode bind y copy-mode
bind C-p paste-buffer bind C-p paste-buffer
# #
@ -130,7 +130,7 @@ bind -t vi-copy y copy-selection
bind -t vi-copy v begin-selection bind -t vi-copy v begin-selection
bind -t vi-copy Escape cancel bind -t vi-copy Escape cancel
# #
# bind ctrl-[0-9] to switching directly to the respective window # bind <alt>[0-9] to switching directly to the respective window
bind -n M-1 select-window -t 1 bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2 bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3 bind -n M-3 select-window -t 3

View file

@ -49,25 +49,29 @@ set-option -g mouse-select-window on
# KEY BINDINGS # KEY BINDINGS
# #
# m and ctrl-m to enabling and disabling the mouse respectively # m and <ctrl>m to enabling and disabling the mouse respectively
bind m set-option -g mode-mouse on \; set-option -g mouse-resize-pane on \; set-option -g mouse-select-pane on \; set-option -g mouse-select-window on \; display 'Mouse: ON' bind m set-option -g mode-mouse on \; set-option -g mouse-resize-pane on \; set-option -g mouse-select-pane on \; set-option -g mouse-select-window on \; display 'Mouse: ON'
bind C-m set-option -g mode-mouse off \; set-option -g mouse-resize-pane off \; set-option -g mouse-select-pane off \; set-option -g mouse-select-window off \; display 'Mouse: OFF' bind C-m set-option -g mode-mouse off \; set-option -g mouse-resize-pane off \; set-option -g mouse-select-pane off \; set-option -g mouse-select-window off \; display 'Mouse: OFF'
# #
# r and ctrl-r to reloading ~/.tmux.conf and /etc/tmux.conf respectively # r and <ctrl>r to reloading ~/.tmux.conf and /etc/tmux.conf respectively
bind r source-file ~/.tmux.conf bind r source-file ~/.tmux.conf
bind C-r source-file /etc/tmux.conf bind C-r source-file /etc/tmux.conf
# #
# \ and ctrl-\ to enabling and disabling the status bar respectively # \ and <ctrl>\ to enabling and disabling the status bar respectively
bind \ set-option -g status on bind \ set-option -g status on
bind C-\ set-option -g status off bind C-\ set-option -g status off
# #
# c and ctrl-c to create a new pane in the current path and in home respectively # c and <ctrl>c to create a new pane in the current path and in home respectively
bind C-c new-window -c '#{pane_current_path}' bind C-c new-window -c "#{pane_current_path}"
bind c new-window bind c new-window
# #
# [ and ] to splitting the window into top/bottom and left/right respectively # [ and ] to splitting the window into top/bottom and left/right respectively
bind [ split-window -v -c '#{pane_current_path}' bind [ split-window -v -c "#{pane_current_path}"
bind ] split-window -h -c '#{pane_current_path}' bind ] split-window -h -c "#{pane_current_path}"
#
# <ctrl>[ and <ctrl>] join another window as a pane split top/bottom and left/right respectively
bind _ choose-window 'join-pane -v -s "%%"'
bind + choose-window 'join-pane -h -s "%%"'
# #
# { and } to rotating up and down respectively # { and } to rotating up and down respectively
bind -r { rotate-window -U bind -r { rotate-window -U
@ -77,13 +81,9 @@ bind -r } rotate-window -D
bind = select-layout even-horizontal bind = select-layout even-horizontal
bind - select-layout even-vertical bind - select-layout even-vertical
# #
# + and _ to vertically/horizontally laying out the panes with one large one on the top/left respectively # < and > to move the current window to the first and last windows respectively
bind + select-layout main-horizontal bind < run-shell "while [[ ! $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') = 1 ]]; do tmux swap-window -s $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') -t $(expr $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') - 1); done"
bind _ select-layout main-vertical bind > run-shell "while [[ ! $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') = $(tmux list-windows | tail -n 1 | sed 's|:.*$||') ]]; do tmux swap-window -s $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') -t $(expr $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') + 1); done"
#
# < and > to swap the current window with the first and last windows respectively
bind < swap-window -t '1'
bind > run-shell "tmux swap-window -s $(tmux list-windows | grep -e '(active)$' | sed 's|:.*$||') -t $(tmux list-windows | tail -n 1 | sed 's|:.*$||')"
# #
# . and , to move and swap the current window respectively (. is set by default) # . and , to move and swap the current window respectively (. is set by default)
bind , command-prompt "swap-window -t '%%'" bind , command-prompt "swap-window -t '%%'"
@ -91,7 +91,7 @@ bind , command-prompt "swap-window -t '%%'"
# $ and # to rename the session and current window respectively ($ is set by default) # $ and # to rename the session and current window respectively ($ is set by default)
bind "#" command-prompt -I '#W' "rename-window '%%'" bind "#" command-prompt -I '#W' "rename-window '%%'"
# #
# Space and ctrl-Space to navigating to the previously selected pane and window respectively # Space and <ctrl>Space to navigating to the previously selected pane and window respectively
bind Space last-pane bind Space last-pane
bind C-Space last-window bind C-Space last-window
# #
@ -108,16 +108,16 @@ bind k select-pane -U
bind l select-pane -R bind l select-pane -R
# #
# ~ to synchronous panes # ~ to synchronous panes
bind ` set-window-option synchronize-panes \; display 'Toggling pane synchronization' bind ` set-window-option synchronize-panes \; display "synchronize-panes: toggled"
# #
# escape to clearing history and screen # escape to clearing history and screen
bind Escape send-keys -R\; send-keys 'C-l'\; clear-history bind Escape send-keys -R\; send-keys 'C-l'\; clear-history
# #
# ? and ctrl-? to keyboard and command help respectively # ? and <ctrl>? to keyboard and command help respectively
bind ? list-keys bind ? list-keys
bind / list-commands bind / list-commands
# #
# y and ctrl-p to copy mode and pasting the copy buffer respectively # y and <ctrl>p to copy mode and pasting the copy buffer respectively
bind y copy-mode bind y copy-mode
bind C-p paste-buffer bind C-p paste-buffer
# #
@ -130,7 +130,7 @@ bind -t vi-copy y copy-selection
bind -t vi-copy v begin-selection bind -t vi-copy v begin-selection
bind -t vi-copy Escape cancel bind -t vi-copy Escape cancel
# #
# bind ctrl-[0-9] to switching directly to the respective window # bind <alt>[0-9] to switching directly to the respective window
bind -n M-1 select-window -t 1 bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2 bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3 bind -n M-3 select-window -t 3