Skip to content

Commit 4ca5fe8

Browse files
committed
mac and tmux config
1 parent 3fc03d0 commit 4ca5fe8

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

docs/misc/mac-and-tmux-config.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Mac and TMUX Config
2+
3+
Some configurations I always struggle with when things are misconfigured and suddenly not working as expected (e.g. when installing a new Mac or after a Mac upgrade).
4+
5+
## Mac
6+
7+
### Jump word in iTerm2 with Option + Key
8+
9+
I want to jump words with `Option + ←` and `Option + →`, respectively. Configure iTerm like this:
10+
11+
1. open iTerm2 Settings with `CMD + ,`
12+
1. navigate to `Profiles -> Keys -> General`
13+
1. Make sure Left Option key is set to `Esc+`
14+
1. add the following Keyboard Shortcuts:
15+
16+
| Keyboard Shortcut | Action | Escape Sequence (Esc+) |
17+
| ----------------------- | -------------------- | ---------------------- |
18+
| `option + Left` (`⌥←`) | Send Escape Sequence | `b` |
19+
| `option + Right` (`⌥→`) | Send Escape Sequence | `f` |
20+
21+
## TMUX
22+
23+
### Resize Pane Shortcut
24+
25+
I want to resize tmux panes with the Shortcut `[TMUX Shortcut - Ctrl-b] + Ctrl + ←`, `[TMUX Shortcut - Ctrl-b] + Ctrl + →`, `[TMUX Shortcut - Ctrl-b] + Ctrl + ↑` and `[TMUX Shortcut - Ctrl-b] + Ctrl + ↓`.
26+
27+
By default, this should be configured in the tmux config already. You can verify it with
28+
29+
```sh
30+
tmux list-keys | grep resize
31+
```
32+
33+
Which should give you
34+
35+
```sh
36+
bind-key -r -T prefix C-Up resize-pane -U
37+
bind-key -r -T prefix C-Down resize-pane -D
38+
bind-key -r -T prefix C-Left resize-pane -L
39+
bind-key -r -T prefix C-Right resize-pane -R
40+
```
41+
42+
If they don't exist, add it to your `~/.tmux.conf` and source it with `tmux source-file ~/.tmux.conf`.
43+
44+
To make it work in iTerm2, do the following:
45+
46+
1. open iTerm2 Settings with `CMD + ,`
47+
1. navigate to `Profiles -> Keys -> General`
48+
1. Make sure Left Option key is set to `Esc+`
49+
1. Add the following keyboard shortcuts:
50+
51+
| Keyboard Shortcut | Action | Escape Sequence (Esc+) |
52+
| ------------------ | -------------------- | ---------------------- |
53+
| `⌃ + Left` (`^←`) | Send Escape Sequence | `[1;5D` |
54+
| `⌃ + Right` (`^→`) | Send Escape Sequence | `[1;5C` |
55+
| `⌃ + Up` (`^↑`) | Send Escape Sequence | `[1;5A` |
56+
| `⌃ + Down` (`^↓`) | Send Escape Sequence | `[1;5B` |

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ nav:
3939
- Airgapped TKGS homelab environment: homelab/airgapped-tkgs.md
4040
- Misc:
4141
- Hello World Apps: misc/hello-world-apps.md
42+
- Mac & TMUX Config: misc/mac-and-tmux-config.md
4243
- Deploy Ubuntu VM on vCenter: misc/deploy-ubuntu-on-vcenter.md
4344
- NSX REST API: misc/nsx-rest-api.md
4445

0 commit comments

Comments
 (0)