Skip to content

Commit

Permalink
Added terminator steps > README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkashz committed Sep 30, 2021
1 parent d18916f commit b084900
Show file tree
Hide file tree
Showing 2 changed files with 198 additions and 0 deletions.
198 changes: 198 additions & 0 deletions README.md
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:
![left](https://user-images.githubusercontent.com/19916930/129307411-9012b0b4-72b5-4a8b-a241-9f254978e4ef.PNG)

Right part:
![right](https://user-images.githubusercontent.com/19916930/129307427-ac231f57-4c30-40e1-a9fe-b31936109168.PNG)

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>&lt;prefix&gt; C-e</code></td>
<td>Open ~/.tmux.conf file in your $EDITOR</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; C-r</code></td>
<td>Reload tmux configuration from ~/.tmux.conf file</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; r</code></td>
<td>Rename current window</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; R</code></td>
<td>Rename current session</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; _</code></td>
<td>Split new pane horizontally</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; |</code></td>
<td>Split new pane vertically</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; &lt;</code></td>
<td>Select next pane</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; &gt;</code></td>
<td>Select previous pane</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; ←</code></td>
<td>Select pane on the left</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; →</code></td>
<td>Select pane on the right</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; ↑</code></td>
<td>Select pane on the top</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; ↓</code></td>
<td>Select pane on the bottom</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; C-←</code></td>
<td>Resize pane to the left</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; C-→</code></td>
<td>Resize pane to the right</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; C-↑</code></td>
<td>Resize pane to the top</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; C-↓</code></td>
<td>Resize pane to the bottom</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; &gt;</code></td>
<td>Move to next window</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; &lt;</code></td>
<td>Move to previous window</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; Tab</code></td>
<td>Switch to most recently used window</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; L</code></td>
<td>Link window from another session by entering target session and window reference</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; \</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>&lt;prefix&gt; C-o</code></td>
<td>Swap current active pane with next one</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; +</code></td>
<td>Toggle zoom for current pane</td>
</td>
<tr>
<td><code>&lt;prefix&gt; x</code></td>
<td>Kill current pane</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; X</code></td>
<td>Kill current window</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; C-x</code></td>
<td>Kill other windows but current one (with confirmation)</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; Q</code></td>
<td>Kill current session (with confirmation)</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; 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>&lt;prefix&gt; d</code></td>
<td>Detach from session</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; D</code></td>
<td>Detach other clients except current one from session</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; C-s</code></td>
<td>Toggle status bar visibility</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; m</code></td>
<td>Monitor current window for activity</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; M</code></td>
<td>Monitor current window for silence by entering silence period</td>
</tr>
<tr>
<td><code>&lt;prefix&gt; 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.

0 comments on commit b084900

Please sign in to comment.