summaryrefslogtreecommitdiff
path: root/docs/tags.md
blob: f1e4a4208dd2c20ce348432ea6e982bd1d2f91cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Editable tags

Pardes has three levels of command text: the workspace tag, one tag per
column, and each pane's tag. Column commands run in that column's active
pane (or its first pane when focus comes from another column). This makes
`New`, `Tty`, `Find`, and `Grep` available beside the work they act on.
`New` appears only in the column tag by default; pane tags keep their own
save, terminal, close, and collapse commands. `Tty` opens a new embedded terminal.
In a terminal's own tag the word names the shell it runs, `Tty+fish`, tinted
with the tag's name colour: `Tty+arg` is one word a tag can hold for `Tty
arg`, so clicking it opens another terminal on that shell, as `Tty fish`
would. Only a builtin that declares `plus_arg` reads a `+` so; `Tty` is the
one, since other arguments (a dump's name) may contain `+`. A command pane's tag reads `<dir> (<line>) running` or `exit N`
and offers `Kill`. `Repl python` in a terminal's tag binds it as Python's
REPL, its id, `python-a`, beside the Tty word: a middle click or the execute
key on a `.py` body then types the text into it rather than running it, and
several bound ask which. The tag's own words, `Exec <text>` by name and a
command word @`cmd` still run as commands (docs/fs.md).
Pane and column command text leave a small gap after their aligned drag grips.
GUI pane mode symbols are centered by their visible ink; changing the font or
its size refreshes the cached measurements.
The column grip has a different
color from a pane grip. It stays blank and muted even when its column is active,
and lights in its full accent while it is held.
Drag it past a neighbour's middle to move the whole column there; dropped short
of that, it moves the column's left edge instead, as a border drag would. While
it is held, a dashed rail in the grip's accent stands where the column's left
edge will land, beside the rule as a border drag's rail does. Only columns
between the old and new positions shift. Each column keeps its width, panes and
command text.

When Look opens the first document and its source column is too narrow for
a new column, it splits below the originating pane, just like `Tty`, instead
of inserting at the top of the leftmost column. The originating terminal is
kept. As with `Tty`, a tagline-only source uses a roomier split parent.

`Collapse` reduces a pane to just its tagline, giving all its body space to
the nearest expanded pane above, or below if none is above. Other panes keep
their heights. Execute it again to reclaim its former height from that one
neighbor, as far as available space allows. If every pane is collapsed, the
unused area stays blank.
Its text and terminal process are kept;
the command stays available in the visible tag. Every default pane tag includes
`Collapse`, including file, terminal, image, and PDF panes.

`Del` closes a pane and gives its rows to one neighbor; the rest of the
column keeps its heights. `Del k` (or `DelAbove`) gives them to the nearest
expanded pane above, `Del j` (or `DelBelow`) to the one below, each falling
back to the other side. Bare `Del` from the keyboard (`SPC d`, or Enter on
the word) on a pane with expanded panes both above and below asks on the
pane's notice band: `k` or Up gives the rows above, `j` or Down below, and
any other key keeps the pane. A click, a 9P write or a startup line never
asks; there bare `Del` gives the rows to the nearest document above, as it
always has. A collapsed pane is never asked about, and collapsed neighbors
are passed over: they only keep a weight for later.

A tag is a text like a pane's body: pane tags, column tags and the
workspace tag all edit with the body's own normal and insert modes, undo
included, and may hold more than one line. A tag with a newline in it takes
a row per line, up to eight: a pane's tag leaves its body at least one row
and a collapsed pane shows only the first line; the column and workspace
tags take no more than a third of the screen, and the panes below move down
to make room. The path, the dirty marker and a PDF's page at the start of a
pane tag are computed, never stored, and read-only. The keyboard reaches
them as the mouse does: `0` goes to the line's start, the path's, as in
acme, and motions select and yank across the path and the commands. An edit
that would change them is refused and leaves the cursor where it was; typing
into a file's path instead drafts a new name, as clicking it does. When they
grow or shrink (a rename, the dirty marker, a PDF's page) the cursor keeps
its place in the text after them.

Left-click a tag or a header to type into it at the click, in insert mode;
tags reveal the caret horizontally when text is wider than their column.
Esc is normal mode, where everything a body's normal mode does works. There
Tab executes the word under the cursor (or an explicit selection), and Enter
looks it up in a pane's tag but runs it in a column or workspace tag, whose
words are all commands; in insert mode Enter is a new line. Executing gives
the keyboard back to the body first, so `Del`, `Kill` and `Restore` never return into a tag that is gone.
Pasted text goes to the focused tag, not to the file or embedded shell
beneath it.

`:` is the one key a tag and a body do not share: in the body's normal mode
it focuses the pane's tag in normal mode, and in the tag's normal mode it
goes back to the body; in a column or workspace tag it goes back to the
active pane. Each pane, column and workspace tag remembers its own cursor
during the session; the first `:` into a pane tag starts on its `Save`. A
tag's text changing under it (a 9P write, a shorter tag) pulls the cursor
back inside it.

Moving between tags is the window keys' job, as it is between bodies
(`Ctrl-w` or `SPC w` with `h/j/k/l`): they move to the neighbouring pane's
body. Up from a pane with nothing above it reaches its column's tag, then
the workspace's; Down comes back the same way, and Left and Right walk the
column tags.

Search (`/`), `s`/`S`, pipe (`|`) and Save's path prompt are not typed into
the tag: each gets a line of its own on the pane's notice band, with the
body's insert-mode keys. Pressed in a tag, `s`, `S` and `|` answer for the
tag's own text, as they do for a body, and a header's go on the active pane's
band; `/` searches the body wherever it is pressed, as acme's Look from a tag
does.

Pane filenames and commands now have a single separator space rather than
generated right-alignment padding. Intentionally customized spacing is kept.

## File names

Clicking a file pane's name, or typing into it from the tag, starts a draft
of it, typed into where it was clicked or typed.
Enter or Tab confirms the new buffer name; Escape or leaving the pane
cancels the draft. Confirmation changes the
buffer's save target and marks it unsaved. It does **not** rename, create or
overwrite a disk file. A subsequent explicit `Save` writes the buffer to its
committed name. Executing a pane-tag command confirms a valid name draft
first, so a visible draft cannot silently save to the previous name.

Terminal working directories and generated image/PDF status remain managed
by their corresponding commands. Their command tails are editable just like
file command tails.

PDF tags follow the same filename-first layout: `manual.pdf [1/12] Tty Del
PdfSections PdfTint Collapse`. Sections and tint commands remain in the editable
tail, without displaying the current tint state. `PdfFit` (`SPC t z`) remains
available, as do the shortcuts for `PdfTint` (`SPC t i`) and `PdfSections`
(`SPC t s`, or `f` on a PDF).

Terminal tags include `Mode`, which cycles through raw terminal input, normal
editor mode, insert mode, and back to terminal input. On files and text output
panes, `Mode` cycles between normal and insert mode; it is available as a command
but does not appear in their default tags. Images and PDFs keep their normal mode.
Executing `Mode` from a tag leaves the tag and advances the parked body mode.

Ctrl-B keeps its terminal/editor toggle. Existing custom tags can still use
`Togglettymode` for that two-way terminal toggle. Old default terminal tags
upgrade to `Mode`; customized command text is preserved.

## Saved workspaces

`Dump` and `Restore` preserve customized workspace and column tags, including
intentionally empty tags. New columns start with the standard column tag.
Closing a column keeps surviving columns' tags; `Joincol` keeps the destination
column's tag. Old dumps without these optional fields retain the defaults.
The automatic `Restore` shortcut does not overwrite a customized workspace
tag.

The column row stays above panes with `TagBottom` enabled. On screens shorter
than three rows it is omitted so a pane still has room. SDL and TTY share the
same tag text, editing and layout; SDL additionally uses compact font sizing
and subtle pixel separators.

`ColumnTags` toggles the column row (on by default) without deleting its text.
`FocusTint` controls active-column and active-pane emphasis. SDL also honors
the shared bold, underline, and strikethrough attributes, including diagnostic
underlines and the optional `SyntaxBold` keyword weight.