forked from samoshkin/tmux-config
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
Updates: | ||
===================== | ||
1. Fixed bugs which caused errors while running tmux post installation. | ||
2. Updated tmux-powerline to reflect tun0 IP when connected using VPN. | ||
3. Cleaned up tmux-powerline; removed status-date and sysstat_loadavg. | ||
|
||
Installation | ||
===================== | ||
To install tmux-config: | ||
``` bash | ||
$ git clone https://github.com/iamkashz/tmux-config.git | ||
$ ./tmux-config/install.sh | ||
|
||
# can jump into tmux session using | ||
$ tmux new | ||
``` | ||
|
||
Setup tmux with terminator | ||
===================== | ||
Note: xclip is needed to fix the mouse copy-paste issue. | ||
```bash | ||
$ sudo apt install terminator xclip | ||
``` | ||
1. Right click on `Terminal Emulator` > `Edit Applicaiton`. | ||
2. Set `Command` as `terminator`. | ||
3. Launch `Terminal Emulator`, `terminator` should launch directly. | ||
|
||
### Auto launch tmux at terminal spawn | ||
1. Launch terminator (or Terminal Emulator if it auto launches terminator). | ||
2. Right click > `Prferences` > `Profiles` tab | ||
3. Under `default` profile, select sub-tab `Command` | ||
4. Set `Custom command` as `tmux`. | ||
|
||
Custom Status line | ||
----------- | ||
Left part: | ||
 | ||
|
||
Right part: | ||
 | ||
|
||
The left part contains only current session name. The right part contains CPU & Memory Usage, username@hostname, tun0 IP (if connected to VPN) and battery indicator. | ||
|
||
Hide/show status bar using `<prefix> C-s` keybinding. | ||
|
||
tmux cheatsheet for beginners | ||
----------- | ||
[TMUX CHEATSHEET](https://tmuxcheatsheet.com/) | ||
|
||
So `~/.tmux.conf` overrides default key bindings for many action, to make them more reasonable, easy to recall and comfortable to type. | ||
|
||
<table> | ||
<tr> | ||
<td nowrap><b>tmux key</b></td> | ||
<td><b>Description</b></td> | ||
</tr> | ||
<tr> | ||
<td nowrap><code>C-a</code></td> | ||
<td>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. | ||
</td> | ||
</tr> | ||
<tr> | ||
<td nowrap><code><prefix> C-e</code></td> | ||
<td>Open ~/.tmux.conf file in your $EDITOR</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-r</code></td> | ||
<td>Reload tmux configuration from ~/.tmux.conf file</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> r</code></td> | ||
<td>Rename current window</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> R</code></td> | ||
<td>Rename current session</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> _</code></td> | ||
<td>Split new pane horizontally</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> |</code></td> | ||
<td>Split new pane vertically</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> <</code></td> | ||
<td>Select next pane</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> ></code></td> | ||
<td>Select previous pane</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> ←</code></td> | ||
<td>Select pane on the left</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> →</code></td> | ||
<td>Select pane on the right</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> ↑</code></td> | ||
<td>Select pane on the top</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> ↓</code></td> | ||
<td>Select pane on the bottom</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-←</code></td> | ||
<td>Resize pane to the left</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-→</code></td> | ||
<td>Resize pane to the right</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-↑</code></td> | ||
<td>Resize pane to the top</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-↓</code></td> | ||
<td>Resize pane to the bottom</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> ></code></td> | ||
<td>Move to next window</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> <</code></td> | ||
<td>Move to previous window</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> Tab</code></td> | ||
<td>Switch to most recently used window</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> L</code></td> | ||
<td>Link window from another session by entering target session and window reference</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> \</code></td> | ||
<td>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.</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-o</code></td> | ||
<td>Swap current active pane with next one</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> +</code></td> | ||
<td>Toggle zoom for current pane</td> | ||
</td> | ||
<tr> | ||
<td><code><prefix> x</code></td> | ||
<td>Kill current pane</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> X</code></td> | ||
<td>Kill current window</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-x</code></td> | ||
<td>Kill other windows but current one (with confirmation)</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> Q</code></td> | ||
<td>Kill current session (with confirmation)</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-u</code></td> | ||
<td>Merge current session with another. Essentially, this moves all windows from current session to another one</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> d</code></td> | ||
<td>Detach from session</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> D</code></td> | ||
<td>Detach other clients except current one from session</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> C-s</code></td> | ||
<td>Toggle status bar visibility</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> m</code></td> | ||
<td>Monitor current window for activity</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> M</code></td> | ||
<td>Monitor current window for silence by entering silence period</td> | ||
</tr> | ||
<tr> | ||
<td><code><prefix> F12</code></td> | ||
<td>Switch off all key binding and prefix hanling in current window. See "Nested sessions" paragraph for more info</td> | ||
</tr> | ||
</table> |
File renamed without changes.