Skip to content

Commit e2658b6

Browse files
committed
docs: Configuration walkthrough
1 parent 5201cc5 commit e2658b6

File tree

1 file changed

+49
-9
lines changed

1 file changed

+49
-9
lines changed

docs/configuration/index.md

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,24 @@ Panes hierarchy. Both JSON and YAML is accepted.
99

1010
## Launching your session
1111

12-
When you have `tmuxp` installed in your environment alongside tmux, you can use:
12+
When you have `tmuxp` installed in your environment alongside tmux, you can load
13+
a workspace with:
1314

1415
```console
1516
$ tmuxp load ./path/to/file
1617
```
1718

18-
to load your workspace and launch directly into tmux.
19+
tmuxp will offers to assist when:
1920

20-
In certain cases, tmuxp will try help you when:
21-
22-
- _If your session already exists_: tmuxp will prompt you to re-attach. It does this
21+
- _Session already exists_: tmuxp will prompt you to re-attach. It does this
2322
by checking if the configuration's `session_name` matches a session already
2423
running on the same server.
25-
- _If you're inside a tmux client already_, `tmuxp` will let you create a new session and switch to it, or append the windows to your existing
24+
- _When inside a tmux client_, `tmuxp` will let you create a new session and switch to it, or append the windows to your existing
2625
session.
2726

2827
## What's in a config?
2928

30-
1. A session name: `session_name: your session`
29+
1. A session name
3130
2. A list of _windows_
3231
3. A list of _panes_ for each window
3332
4. A list of _commands_ for each pane
@@ -39,8 +38,10 @@ session_name: My session
3938
windows:
4039
- window_name: Window 1
4140
panes:
42-
- echo "pane 1"
43-
- echo "pane 2"
41+
- shell_commands:
42+
- cmd: echo "pane 1"
43+
- shell_commands:
44+
- cmd: echo "pane 2"
4445
```
4546
4647
````
@@ -56,6 +57,45 @@ As of 1.11.x.
5657
5758
````
5859

60+
Breaking down the basic configuration into sections:
61+
62+
1. A session name
63+
64+
```yaml
65+
session_name: My session
66+
```
67+
68+
2. A list of _windows_
69+
70+
```yaml
71+
windows:
72+
- window_name: Window 1
73+
panes: ...
74+
# window settings
75+
- window_name: Window 2
76+
panes: ...
77+
# window settings
78+
```
79+
3. A list of _panes_ for each window
80+
81+
```yaml
82+
windows:
83+
panes:
84+
- # pane settings
85+
- # pane settings
86+
```
87+
4. A list of _commands_ for each pane
88+
89+
```yaml
90+
windows:
91+
panes:
92+
- shell_commands:
93+
- cmd: echo "pane 1 - cmd 1"
94+
# command options
95+
- cmd: echo "pane 1 - cmd 2"
96+
# command options
97+
```
98+
5999
## Reference and usage
60100

61101
```{toctree}

0 commit comments

Comments
 (0)