Tmux 2 Configuration ===================== Tmux configuration, that supercharges your "tmux" terminal environment, and make you feel like a boss.  Features --------- - "C-a" prefix instead of "C-b" (screen like) - support for nested tmux sessions - configurable visual theme/colors, with some elements borrowed from [Powerline](https://github.com/powerline/powerline) - can apply different configuration whether your session is on local or remote machine - supercharged and cozy status line - status line: CPU, memory usage, system load average metrics - status line: username and hostname, current date time - status line: battery information in status line - status line: visual indicator when you press `prefix` - status line: visual indicator when pane is zoomed - status line: online/offline visual indicator - toggle visibility of status line - monitor windows for activity/silence - scroll and copy mode improvements - prompt to rename window right after it's created - highlight focused pane - merge current session with existing one (move all windows) - integration with 3rd party plugins: [tmux-sidebar](https://github.com/tmux-plugins/tmux-sidebar), [tmux-copycat](https://github.com/tmux-plugins/tmux-copycat), [tmux-open](https://github.com/tmux-plugins/tmux-open), [tmux-plugin-sysstat](https://github.com/samoshkin/tmux-plugin-sysstat) TBD: - [ ] retain current path when new pane is created - [ ] integration with clipboard - [ ] fix pane resizing - [ ] key binding to close all windows but current one - [ ] fix installation script to properly install TPM - [ ] change zoom action key binding to `prefix +` Installation ------------- The prerequisite is to install tmux >= "2.4". ``` $ git clone https://github.com/samoshkin/tmux-config.git $ ./tmux-config/install.sh ``` Installation script will copy files to `~/.tmux` directory, symlink main `~/.tmux` config file, install Tmux plugin manager (if not already installed), install configured tmux plugins. If you already have existing `~/tmux.conf`, backup will be created. General settings ---------------- Windows and pane indexing starts from `1` rather than `0`. Scrollback history limit is set to `20000`. Automatic window renameing is turned off. Aggresive resizing is on. Message line display timeout is `1.5s`. Mouse support in `on`. 256 color palette support is turned on, make sure that your parent terminal is configured propertly. See [here](https://unix.stackexchange.com/questions/1045/getting-256-colors-to-work-in-tmux) and [there](https://github.com/tmux/tmux/wiki/FAQ) ``` # parent terminal $ echo $TERM xterm-256color # jump into a tmux session $ tmux new $ echo $TERM screen-256color ``` Key bindings ----------- So `~/.tmux.conf` overrides default key bindings for many action, to make them more reasonable, easy to recall and comforable to type. Let's go through them:
C-a |
Default prefix, used instead of "C-b". Same prefix is used in screen program, and it's easy to type. The only drawback of "C-a" is that underlying shell does not receive the keystroke to move to the beginning of the line. |
<prefix> C-e |
Open ~/.tmux.conf file in your $EDITOR |
<prefix> C-r |
Reload tmux configuration from ~/.tmux.conf file |
<prefix> r |
Rename current window |
<prefix> R |
Rename current session |
<prefix> _ |
Split new pane horizontally |
<prefix> | |
Split new pane vertically |
<prefix> < |
Move to previous window |
<prefix> > |
Move to next window |
<prefix> M-< |
Move to previous window with alert |
<prefix> M-> |
Move to next window with alert |
<prefix> Tab |
Switch to most recently used window |
<prefix> W |
Move to window by typing it's index |
<prefix> L |
Link window from another session by entering target session and window reference |
<prefix> \ |
Swap panes back and forth with 1st pane. When in main-horizontal or main-vertical layout, the main panel is always at index 1. This keybinding let you swap secondary pane with main one, and do the opposite. |
<prefix> o and O |
Select/focus panes in forward and backward direction |
<prefix> C-o |
Swap current active pane with next one |
<prefix> x |
Kill current pane |
<prefix> C-x |
Kill current window (with confirmation) |
<prefix> X |
Kill current session (with confirmation) |
<prefix> C-u |
Merge current session with another. Essentially, this moves all windows from current session to another one |
<prefix> d |
Detach from session |
<prefix> D |
Detach other clients except current one from session |
<prefix> C-s |
Toggle status bar visibility |
<prefix> m |
Monitor current window for activity |
<prefix> M |
Monitor current window for silence by entering silence period |
<prefix> F12 |
Switch off all key binding and prefix hanling in current window. See "Nested sessions" paragraph for more info |