查看器
本页是仓库里的文档,内容为英文。
The viewer (F3)
The viewer never loads a file. It reads the window it is showing, so a forty-gigabyte log
opens at once and End is one seek rather than a count of lines.
F2 cycles the wrapping, F4 turns the wheel of ways to read the file — text, a byte dump,
hex, a laid-out document, a table — stopping only on the ones this file has a use for, with
the key bar saying where the next turn lands; Shift+F4 is hex and straight back.
Shift+F8 is every code page the program offers, as a list you type into: Enter reads the
file as one, Ins marks a page as one you use — it gets a * and comes to the top — and F4
gives it a name of your own. F8 then walks the pages you marked, and the five the program
handles itself while you have marked none.
F7 opens the search dialog: what to look for, whether it is plain text, a run of hex
bytes or a regular expression, whether case matters, whether only whole words count — and
then Find next or Find previous, because they are the same question asked twice.
Shift+F7 and Alt+F7 repeat it forwards and backwards without asking again. F6 hands the file to the editor at the same place. Alt+F5 prints it (see Printing in the files chapter).
Shift+F follows the file as it grows, the way tail -f does: once a second the viewer looks,
and when something has been written it shows the new end. Scroll back to read and it leaves
you there until more arrives; Shift+F again stops it.
In the hex dump the arrows set how many bytes a row holds, since sideways means nothing else
in a dump: → widens it and ← narrows it, eight bytes at a time — 8, 16, 24, 32 and so
on up to 64 — because eight is the group the dump already draws a gap between, so every press
adds one whole group and the columns stay where your eye expects them. A press that would need
a wider window than you have leaves the width alone. Ctrl+→ and Ctrl+← are something else:
they nudge the whole dump along by a single byte, so a structure that does not begin on a
multiple of the row width can be read in line instead of diagonally.
Gray + and Gray - step to the next and previous file of the panel without leaving the
viewer, and Ctrl+F10 goes back to the panels with the cursor on the file you are reading —
in the folder the panel shows if it is there, and otherwise in the file's own folder, which is
where a file opened from a search or from fcmd --view takes it.
Three keys give the window to the file. Ctrl+B takes the key bar away, Ctrl+Shift+B the top
line with the name and the position, and Ctrl+S puts a scrollbar down the right edge — each
row you take away is a row of text you get, which is what a long line or a wide hex dump wants.
They apply to the file you are reading and nothing is written down: F9 → Options → Viewer settings is where you say what every file should open with, along with the wrapping and the
tab width.
Markdown
A .md file opens laid out rather than as its source: the marks come off and the space they
held is put to use. A heading is bold with a rule under it, a list is bullets with hanging
indents and a task list is boxes, a quote gets a bar down its left side, a link shows its text
and its address, a fenced block is indented and — where the fence named a language — coloured
as that language, and a table is drawn with its columns lined up and aligned the way its
delimiter row asked for.
Shift+F2 switches between the laid-out document and its source, and Shift+F4 has it in the
cycle with the text, the dump and the hex. Searching a laid-out document searches what is on
screen, not the marks behind it, so looking for a word in a table finds it in the cell.
This is the one place the viewer reads more than it shows: a table's columns cannot be worked out from the part of it that happens to be on screen, so the document is rendered whole. Over four megabytes it stays the source, and says so. Interface → Markdown laid out to be read turns the first screen back into the source for good.
Office documents
F3 on a word processor's document shows its text, laid out the same way: .docx and .odt
(and Word's .docm, .dotx, .dotm, OpenDocument's .ott). Headings are headings, by the
style the document gave them; paragraphs are wrapped to the window; bulleted and numbered
lists are lists; a table is drawn with its columns lined up, its first row as the heading;
bold, italic and struck-out text keep their look; a line break and a tab stay where they
were; a picture is [image: name]; a footnote is [1] in the text and [1] with its words
at the end. A presentation — .pptx, .ppsx, .odp — shows the text of each slide under
Slide 1, Slide 2…, in the order they are shown: the title, the points as bullets, the
tables.
It is the text and not the page: no fonts, sizes, colours, columns or page breaks, no headers and footers, no comments, and nothing that was deleted with tracked changes on.
The keys are Markdown's. Shift+F2 switches between the text and the source — which for a
document is the file itself, a zip, shown as bytes — F2 goes to the source too, and F4
has the text in its cycle after the hex. F7 searches the text as it is on the screen.
Shift+F11 still shows what the document says about itself: title, author, dates, pages.
Interface → Markdown laid out to be read is the setting for these too: off, a document
opens as its bytes and Shift+F2 lays it out.
A document inside an archive or on a server is laid out like any other. One whose text is
longer than four megabytes, or whose XML is longer than sixteen, is not laid out and the
status line says so — the sizes a file declares are not believed, so a document built to
swell when opened is refused rather than read. Spreadsheets (.xlsx, .ods) and the older
.doc are not laid out: their properties are in Shift+F11.
Pictures
A .png, a .jpg, a .gif or a .bmp opens as the picture. F4 goes on from there to the
dump and the hex for the times you came for the bytes — the file is still a file.
It is drawn in real pixels where the terminal has a way to take them, and in half blocks everywhere else.
Real pixels come by one of three protocols: kitty's (kitty, Ghostty), iTerm2's inline
images (iTerm2, WezTerm) and sixel (foot, mlterm, contour). fcmd knows those terminals
by what they export in the environment and never asks one what it can do: a question a
terminal does not answer leaves a program waiting, and one it answers late is typed into
whatever you are doing by then. A terminal it cannot vouch for gets half blocks, and you can
say otherwise — Options → Viewer settings → Pictures, or viewer.pixels in fcmd.toml:
sixel for Windows Terminal 1.22 or later and for xterm -ti 340, iterm for VS Code's
terminal with its own image setting on, kitty for Konsole, off for half blocks always.
Inside tmux, screen or zellij auto means half blocks. Where things are kept → Pictures in
real pixels has the whole of it.
Half blocks are what is left when there is no such way: a cell is about twice as tall as it is
wide, so one holding ▀ with the top half one colour and the bottom another is two pixels
that are nearly square, and the window is a canvas twice as tall in pixels as it is in rows.
It is coarse, and it works in every terminal there is. A picture is drawn in them first, for
the moment its pixels take to prepare, and again whenever a dialog or a menu is drawn across
it: an image lies on top of the text, and would cover them.
What the file is decides, not what it is called: a .txt that is really a PNG opens as the
picture. A photograph is fitted into the window keeping its shape and a small icon is left at
its own size rather than blown up into coloured squares. What is transparent shows the
viewer's own background through it.
Nothing scrolls — the picture is already the size of the window — and a file that is damaged, too large, or not a picture says so instead of leaving you looking at a blank screen.
Video
F3 on a video — MP4, MOV, MKV, WebM, AVI — shows a frame of it, drawn as a picture is: real
pixels where the terminal has them, half blocks elsewhere. It opens a tenth of the way in,
past the black frame most films start with, and the top line says where the frame is, how long
the film runs, and what it is: 00:12 / 02:00 H.264/AVC 1920×1080.
| Key | What it does |
|---|---|
PgDn, → | a tenth of the film forward |
PgUp, ← | a tenth back |
Home, End | the first frame, the last one |
Space | play from this frame, and pause |
F4 | on to the dump and the hex, where the keys turn pages again |
Shift+F11 | the container: tracks, codecs, tags |
The quick view (Ctrl+Q) shows the same frame, a tenth of the way in, as the cursor passes.
Playing is a preview and not a player: eight frames a second and no sound, because every frame
is a whole picture sent to the terminal. It stops at the end, when you step, and when you
leave. Over a slow connection half blocks keep up where pixels do not (viewer.pixels = "off").
fcmd decodes no video itself. The frames come from ffmpeg, run as a program when it is
on the PATH and never part of fcmd. Without it the viewer says that it is missing and what
the file is, opens the file as its bytes as it always did, and Shift+F11 still reads the
container; Alt+F1 → External programs lists ffmpeg, and F4 there installs it. A file
that holds only sound — an .m4a, a .mka — is not a film and is not handed to it.
Sound
p on a sound file — MP3, FLAC, Ogg, WAVE, AIFF, .m4a — plays it, p again pauses it and
plays on from there, and Shift+P stops it. The status line leads with ▶ time / length
(⏸ while paused); the length is the one Shift+F11 reads from the file. Leaving the
viewer, or going on to another file, stops it.
The sound comes from a player on the machine, run as a program with no window: ffplay,
which comes with ffmpeg, or else mpv. Without either the status line says so, and
Alt+F1 → External programs lists both. A file on a server is played from the copy F3
fetched.
Decoding
Alt+B decodes a file that is somebody's bytes written down as text — base64, base32,
UUencode, XXencode, yEnc, quoted-printable, hex, percent-encoding, worked out from the file —
and shows what came out, keeping the file's own name in the title. A file that holds several
shows the first and says how many there are. Shift+F2 saves what came out, under the name the
file carries, asked first; a file that is already there is not written over.
For base64: A certificate, a key, an attachment pulled out of a mail, a data: URI pasted into
a file: all of them are bytes written down in sixty-four printable characters, and all of them
are unreadable until something undoes that.
What came out decides how it is drawn: text when it is text, the hex pane when it is not, which is the usual case. The status line says how many bytes came out, which is how you know the decode was the right one.
Three shapes are read: the bare payload, wrapped or not, padded or not; PEM armour, where
the -----BEGIN …----- lines are skipped and what is between them is decoded; and a data:
URI, where everything up to ;base64, is a label. Both alphabets work — the standard one
and the URL-safe one a token uses.
A file that is only mostly base64 is refused, and the message says which byte stopped it and
where: decoding as far as the first bad character would hand you bytes nobody wrote. The key
does not toggle back, because this is the one view that replaces the file rather than drawing
it another way — Esc and opening it again are the way back.
Tables
A .csv, a .tsv, a .jsonl or a .dbf opens as a table rather than as the commas, the
braces or the hex: a
heading that stays where it is while the rows scroll under it, columns lined up, one record to
a row. Shift+F3 switches between the table and the source — the source is sometimes the thing
one came to look at — and Shift+F4 has the table in the cycle with the text, the dump and the
hex. F7 searches what is on the screen, so looking for a value finds it in its cell.
Shift+F3 is not limited to those names: it makes a table of any file that reads as one,
so a .txt of tab-separated columns or a log laid out in columns opens as a table too. It
refuses only a file with no table in it — one that is not text at all, or one that does not
come apart into two columns or more — and since the same key goes back, a wrong guess costs
one keystroke. What opens by itself is the shorter list, because what a file opens as has to
be predictable.
← and → move the window sideways across a table wider than the screen, and stop where the
last column ends rather than scrolling on into nothing. Ctrl+← and Ctrl+→ jump a whole
column at a time — a table has a unit for sideways that a wall of text has not. ↑ and ↓
move a cursor from row to row, and the rows scroll under it once it reaches the edge of the
window; Home and End go to the first and the last row.
Rows are marked the way files are in a panel: Ins or Shift+↓ marks the row under the cursor
and moves down, Shift+↑ moves up, and the same key on a marked row takes the mark off.
Ctrl+C (or Ctrl+Ins) puts the marked rows on the clipboard — the row under the cursor when
none is marked — with the heading first, the cells separated by tabs, which is what a
spreadsheet pastes into its own cells; a cell holding a tab, a line break or a quote is quoted
so the paste comes apart in the same places. The rows keep their marks through a sort or a
filter, and are copied in the order you see them.
Ctrl+F3 sorts the rows by the column you are on: once up, again down, a third time back to
the order the file has them in. Ctrl+F7 asks what a row has to hold and keeps only those
rows; an empty answer gives them all back. A column of numbers sorts as numbers, so 1000 comes
after 9 rather than before it, and the status line says what the view is doing — ↑name,
/tor — so you can always see it. Neither writes anything: what changes is the order the rows
are read in, the file is untouched, and a search or a bookmark still means the record itself.
A table of more than two hundred thousand records refuses both and says so, because reading a
million records for one keystroke is not what this mode is for. A table of text is never
written from here: a viewer that writes is an editor, and F4 is where that lives. The one
table that is written is a dBase table, a record at a time — see Changing a dBase table
below.
The status line says what the file was read as, which delimiter was guessed — a comma, a
semicolon, a tab, a bar or a caret (^), whichever gave a table — and how many rows and
columns there are: that is how you can tell at a glance that the guess was right. A .tsv is
not guessed at.
Whether the first line is a heading is guessed too, from what is under it: a word over a
column of numbers, or over a column of codes that all have one length, is a heading; a number
over numbers, or a value that turns up again further down, is data. A file with no heading
shows its columns as #1, #2… and the status line says no heading. When the guess is
wrong, Ctrl+H turns it round — the heading becomes the first row, or the first row the
heading. JSON Lines and dBase name their own fields, so there is nothing for it to turn. For
JSON Lines the columns are the keys of the first two hundred records, in the order they are
written in the file; a record with a key that turned up later shows it in a last column called
… rather than losing it, and a line that is not an object is counted at the end of the status
line rather than shown as a row of nonsense.
A .dbf is different and better: a dBase table says in its own header how many records it
has, how long one is and what the columns are called, so nothing is read but the window you are
looking at — a two-gigabyte table opens as fast as a log, and the size limit below does not
apply to it. Dates come out as YYYY-MM-DD, true and false as words, a
memo field as what the .dbt or .fpt beside the table holds, on one line, and the numeric
fields sit on the right of their column, because a column of numbers is read down its last
digit. A deleted record is shown rather than left out — a table whose deleted rows vanish
is one whose count does not add up — and the * that says so has a narrow column of its own
in front of the fields, where it cannot be mistaken for part of a number.
The text comes out in the code page the header names, DOS ones included: a table written under
DOS in Germany is in code page 437, and temporäre reads as temporäre rather than as
tempor„re. Code pages 437, 850, 852, 865 and 866 and the Windows pages are read exactly.
A table that names no code page — a Clipper table does not — is read as Windows-1252
until you say otherwise: Ctrl+T, or F8 or Shift+F8, which in a dBase table mean the
table's own page, goes to the next of CP437, CP850, CP852, CP865, CP866, CP1250, CP1251 and
CP1252, and after the last back to saying nothing. Stop on the one in which the accented
names read right. The status line shows it, the choice holds for that table for as long as
the program runs, and from then on what you type into the table is written in that page.
Visual FoxPro's own things are read as well: a field with no value shows NULL, a field of
varying length (V, Q) shows as much as it holds, and the files Visual FoxPro keeps its
databases, forms, reports, classes, menus, projects and labels in — .dbc, .scx, .frx,
.vcx, .mnx, .pjx, .lbx — open as the tables they are, with their memo files.
More of a dBase table than a row of cells:
| Key | What it does |
|---|---|
Enter on a memo cell, or m | the whole text of the memo, in place of the table; Esc or Backspace goes back to the table |
Shift+F11 | the structure: every field with its type, width, decimals, offset and flags |
Ctrl+F5 | show the marked rows only, and every row again (any table, not only dBase) |
Ctrl+F6 | the sum of every numeric column, over the marked rows or over all the rows shown, with how many rows had a number |
Ctrl+F9 | export the marked rows, or all the rows shown, to a new file |
Ctrl+T, F8, Shift+F8 | the code page of a table that names none |
Ctrl+F9 asks for a name and writes the rows in the order you see them, beside the table
unless the name says where. A name ending in .dbf makes a table of the same structure, the
records exactly as they are, with the memo file copied whole beside it under the new name so
that every memo is still found; any other name makes a CSV file in UTF-8 with the field names
on the first line. A file that is already there is never written over: choose another name.
The keys are those of the FAR plugin LookDBF where they were free here; its F5, F6 and
F9 take Ctrl, because the viewer already uses those three.
Changing a dBase table
A .dbf on a local disk can be changed where it is read, a record at a time. The keys are the
panels' own with Ctrl held, as sorting is:
| Key | What it does |
|---|---|
Ctrl+F4 | type a new value over the cell: the cursor's record, the column the view is on (Ctrl+←/Ctrl+→ choose it) |
Ctrl+N | append an empty record, and put the cursor on it to be filled in |
Ctrl+F8 | delete the record under the cursor, or recall it: the * in the first column |
Ctrl+D | delete every marked record, after one question that says how many |
Ctrl+R | recall every marked record, likewise |
Shift+Del | Pack: take the deleted records out for good |
Before the first change to a table in a session a dialog says the table is about to be
altered and that a backup is wanted first, and makes it: a copy of the table, of its memo
file and of its index files beside them, named with the date and the time — CLIENTI.DBF becomes
CLIENTI.20261125-083015.DBF, CLIENTI.DBT becomes CLIENTI.20261125-083015.DBT — year,
month, day, then hours, minutes and seconds, so the copies sort by name in the order they
were made, and the extension last, so a copy still opens as a table. The buttons are Back up
and edit and Cancel, and nothing is written before the answer. After it, the other changes
of that session to that table go straight through.
A table with index files is written only after you have been told about them. An index
is the table's when its name begins with the table's name and it ends in .ntx, .cdx,
.mdx, .nsx or .idx: for pippo.dbf that is PIPPO.CDX, pippo1.ntx,
pippo_nome.ntx; any other index in the folder belongs to another table and is left out of
it. Right after the backup a second dialog names those files and says what follows from
them: FinalCommander does not update an index, so after the change the indexes no longer
match the table and must be rebuilt (reindexed) by the program they belong to — the
Clipper, Harbour or FoxPro program that uses the table. Go on writes; Cancel writes
nothing. You are asked once for a table in a session, and again if a new index turns up.
The backup holds a copy of the indexes as they were.
What is typed is checked against the field, and written exactly or not at all:
- a character field takes what fits in its width, in the table's own code page. A letter
that page has no byte for is refused and named, never replaced with a
?. A table whose header names no code page — a Clipper table does not — takes plain ASCII alone until you have chosen its page withCtrl+T(above), and so does one in a DOS page this program reads only approximately (860, 861, 863), for the same reason: a guessedèwould land on the wrong byte; - a number (
N,F) is digits, a minus sign and a decimal point, laid out to the field's width and decimals.12.5goes into two decimals as12.50;12.505does not go, because it would have to be rounded; - a date is typed the way it is shown,
1975-03-12(the eight digits alone are taken too), and has to be a day of the calendar; - a logical is
trueorfalse(T,F,Y,Nare taken too); - an empty answer empties the field;
- a memo field, and the binary types (integer, currency, double, date-time), are shown and not written: the key says so.
Pack counts the deleted records first and asks, saying how many will go. It does not rewrite
the table where it stands: the records that stay are written to a new file beside it, and when
that file is whole it is renamed into place — there is never half a packed table on disk.
Every change leaves the header right — the record count, the date of the last update, the end-of-file byte after the last record. The table is opened for writing only for the moment of each change, so a program that has it open is not kept waiting; when the table cannot be opened for writing — read-only, or held by another program — the status line says so and nothing changes. A table that another program restructured while it was on screen is not written either: open it again. A table inside an archive or on a server is a copy, and is not changed. A Visual FoxPro table with a field it numbers by itself does not take a new record here.
Like a laid-out Markdown document, a text table is read whole — a column's width cannot be
known from the part of the file on screen — so over sixteen megabytes the file opens as text
and says so. Interface → Open a .csv or a .jsonl as a table turns the first screen back into the
source for good. A cell longer than forty columns is cut with a …; the horizontal scroll is
how the rest of it is read.
What this mode is not: a spreadsheet and a query tool. There is no editing, no sorting and no filtering, because each of those wants an answer about writing the file back, which a viewer does not have.
Text is coloured by the language the file's name implies, as it is in the editor. The viewer reads only what it shows, so the colouring starts at the top of the screen: a comment that was opened higher up in the file is not carried down to it. That is the price of opening a forty-gigabyte log at once, and only the viewer pays it — the editor has the whole file and colours it exactly.
Binaries
F5 disassembles, in colour: jumps, calls and returns stand out from the rest, registers and
numbers are told apart, and each function's name heads its code. The hex view is coloured by
byte — zeros dim, so the code and the strings in a file are where the colour is. x86, x86-64
and AArch64 are decoded in the program itself; on another
architecture it asks objdump, and says so instead of guessing. A WebAssembly module is
printed as its text format (WAT), with the names its name section gives, and Shift+F11
lists its sections, imports, exports and functions. AArch64 instructions are four
bytes each, so a word nothing decodes is one (bad) line rather than four, and a branch is
shown as the address it arrives at rather than as the displacement in the encoding. Enter on a call or a jmp follows it and
Backspace comes back, with the places you jumped from kept on screen.
Over a disassembly F7 searches the instructions, not the bytes: call finds every call,
mov *, eax every move into that register, and * stands for whatever lies between the pieces
of the pattern.
Shift+F11 opens the structure of an executable: ELF, PE, Mach-O, ar, and the older families — NE,
LE and LX, and the TE that UEFI firmware is made of — each header field with the
raw bytes beside the meaning, the sections, the imports and exports, and the symbols — which
then name the functions in the disassembly. Enter on an offset takes the bytes there.
It also says what the program says about itself:
- a Windows program (PE): the version resource — file and product version, company, description, copyright, original name — the execution level its manifest asks for (whether starting it raises a UAC prompt), the mitigations it opts into (ASLR, DEP, Control Flow Guard), the PDB its debug information went to, and whether it is signed and by whom;
- a Linux program (ELF): the build id, the oldest kernel it runs on, the compilers that built it, the file its debug information was split into, a Go build id or the package it came from;
- a macOS program (Mach-O): the UUID, the oldest macOS or iOS it runs on and the SDK, the tools, each library's version, and the code signature — identifier, team, ad-hoc or not, hardened runtime.
A signature is read and not verified: the pane names the certificates, and says so. Whether a signature is valid depends on the machine that will trust it, so that check is left to the system's own tools.
The same key answers for the files that are not programs:
- a video or a sound — MP4, MOV, M4A, MKV, WebM, AVI, WAV: how long it is, the tracks, the
codec of each, the resolution or the sample rate, the language, the tags, and the boxes or
chunks of the container as rows
Enterfollows; - a PDF: the version, how many pages, the paper of the first one, the title, the author and the producer, whether it is encrypted and what it then allows, how many times it has been saved since it was written — and the pages themselves, each row going to its object;
- a photo — JPEG, PNG, GIF: the size, and for a JPEG the EXIF — camera, lens, when it was taken, exposure, aperture, ISO — and where it was taken, on a row of its own, because that is the thing in a photo people most often do not know they are sending; a PNG's text (compressed or not) and time; a WebP's size, animation and EXIF;
- a picture an image model made — an AI generation section with what it was made
with and how: the tool (ComfyUI, AUTOMATIC1111, Forge, Fooocus, SwarmUI, InvokeAI, NovelAI),
the model, its LoRAs and their weights, the text encoders and the VAE, the prompt and the
negative one, the seed, the steps, cfg and Flux guidance, the sampler, the scheduler and the
size. ComfyUI's graph is followed back from the sampler —
KSampler, or Flux'sSamplerCustomAdvancedthroughRandomNoise,FluxGuidance,BasicScheduler,UNETLoaderandDualCLIPLoader— so the summary is what actually ran.Enteron the prompt (graph) or workflow row opens the whole of it, the JSON laid out, andF4goes back. A picture with content credentials (C2PA) says who signed the claim and whether it calls the picture generated. To take any of this out, Files → Strip picture metadata (file.strip_metadata) on the pictures in the panel: all of it, only what the image model wrote, or all but the camera's EXIF and the copyright (the GPS position goes). The picture is not encoded again — its pixels are the same bytes — andCtrl+Alt+Zputs the metadata back; - an office document —
.docx,.xlsx,.pptx,.odt,.ods,.odp, and the older.doc,.xlsand.ppt: the title, the author and who saved it last, when it was made and changed, how many revisions, pages, words or slides, the company and the program that wrote it; for the older ones also the streams the file is made of; - a mail message —
.emland Outlook's.msg: who sent it, to whom, the subject and the date, and under them the tree of its parts, each with its type, encoding, size and name — the same treestructure.txtshows when the message is opened as a folder (Mail files).Enteron a part of an.emlgoes to where it starts in the file; - music — MP3, FLAC, Ogg Vorbis, Opus: the title, the artist, the album, the year, the
track, the genre, the cover (front, back… and its format;
Enteron it shows the picture,F2goes back to the bytes), and for FLAC and Ogg the stream and its length. An MP3 also shows its links (the song's page), the extra texts it carries, the lyrics — on one row, withEnteropening the words line by line — and, from its first audio frame, the format, the sample rate, the channels, the bitrate and the exact length. A song made with Suno says so, with the moment it was created and its id on Suno, and its signed C2PA manifest is shown as content credentials.
Shift+F11 shows no picture of the file. A video's frames are what F3 itself shows (Video,
above); for the text of a PDF or ffprobe's own account of a film, set up a [[decompile]]
rule (pdftotext, ffprobe) and press Shift+F6.
Shift+F5 does the same thing without a rule: it asks for a command, hands it this file, and
reads what the command printed instead of the file — strings, xxd, pdftotext, objdump -d, jq ., a script of your own. The file is put at the end of the line unless the line
already names it (!.! is where it goes if you want it in the middle), the whole of it is run
by your shell, so pipes work, and Backspace goes back to the file itself. It is Midnight
Commander's filtered view, and it is the answer to every format nobody has written a rule for.
Ctrl+Alt+G — the panel's git key — asks git who wrote the file: git blame, the commit, the
author and the date in front of every line, opened on the line that was at the top so what you
were reading is still on the screen. Backspace goes back to the file.
Source files, class files and bytecode get a listing of their own where one makes sense: a
.class is shown the way javap -c shows it, with the constant pool resolved into the
comments.
Two files side by side
Ctrl+Shift+D — View file differences in the Commands menu — puts the file under the left
panel's cursor beside the file under the right panel's and marks what differs. Compare by
content answers which of a hundred pairs differ; this answers what, in one pair, is
different.
The left file is the before and the right one the after, and the screen reads like a
diff: what only the left side has is painted on red, the whole line, with a - beside its
number, what the right side brings is painted on green with a +, and a line that changed is both — red on the left, green on the
right — with the part that actually changed marked inside it, so the eye goes to the one
character that matters. Each column carries its own line numbers, and a line that exists on one
side only has a number on that side and nothing opposite it. The foot says which difference of
how many is on screen, and how many lines went and came (-3 +5).
Alt+↓ and Alt+↑ go from one difference to the next, which is how one reads a diff; the last
one says it is the last rather than wrapping round. The arrows, PgUp, PgDn, Home and
End move by rows, ← and → scroll both columns together, and Tab changes which column is
the one being read. F12 lists this screen with the open viewers and editors, F1 opens this
chapter, and Esc, F3 or F10 closes it.
F5 takes a difference across: the column you are in takes the other one's version of the
difference at the top of the screen, so Tab chooses which file changes and Alt+↓ chooses
which difference. Whole lines move — a line only the other side has is added, a line only this
side has goes — and a line coming out of a Unix file into a DOS one is given DOS line endings,
so you do not end up with the one odd line in it. On a line both files agree about, F5 says
there is no difference here rather than taking the next one by surprise.
Nothing is written until F2. The file that took something carries a * beside its name,
F2 writes it — beside the original and renamed over it, so an interruption leaves what was
there whole — and once written the * goes, so a second F2 has nothing to do and says so.
Esc with something unwritten says so and leaves at the next press, which is how a screen with
no dialog of its own asks whether you meant it.
U shows the same comparison as one column instead of two, the way a patch reads: a line both
files have once, with its number in each, and a difference as the lines that went, - and
red, followed by the lines that came, + and green. Everything else is the same screen —
Alt+↓, F5, F2, the three keys below — and U again puts the two columns back.
Shift+F2 saves the comparison as a patch: a unified diff with three lines of context around
each change, the kind patch and git apply take. It asks for a name, offering the right
file's with .diff after it; a name with no folder in front lands in the active panel's
folder, and Esc at the question comes back to the comparison. What is saved is what is on
the screen, so differences taken across with F5 are in it, and with blanks or case ignored
the patch is one to read rather than to apply. Two files that are the same have no patch, and
the key says so.
Three keys change what counts as a difference, and each lines the two files up again at once:
W ignores blanks, C ignores case, E ignores how the lines end. Line endings start from
what the comparison dialog was last told, so the two agree about what "the same" means — the
same checkout on Windows and on Linux differs in every line and in nothing that matters.
Two files that are the same open all the same, and the screen says so rather than leaving you scrolling for a difference that is not there.
Both files have to be on this disk and under 16 MiB: the whole of each is read into memory to line them up, so a file on a server or inside an archive says so by name rather than fetching a copy you did not ask for.
Two files that are not text — two builds of a program, two firmware images, two pictures —
are compared byte against byte instead: byte 0 with byte 0, to the end of the longer one. The
same key opens it; which screen you get is decided by what the files are. The comparison runs
in the background, however large the pair, and Esc stops it. When it is back the screen is
at the first difference: one column of offsets, then each file's bytes in hex and as
characters, the left file's on the left. A byte the two disagree about is red on the left and
green on the right, and where the shorter file has ended its side is empty. The line with the
names says how long each file is, to the byte; the foot says which difference of how many is
on screen, the offset of the first one, and how many bytes differ in all.
Alt+↓ and Alt+↑ go from one difference to the next — a difference being a run of bytes
that differ — and the arrows, PgUp, PgDn, Home and End move by rows. Two files with
the same bytes say so, with their length. Nothing can be merged or written here: to change a
byte, F4 on the file is the hex editor. The comparison is by position, as cmp does it, so
a byte inserted near the start makes everything after it differ.
Delphi
Delphi's own files are read the way Delphi shows them.
Forms. A .dfm, .fmx, .lfm or .xfm saved as text is coloured — object, end,
the properties, the strings, the binary data in { … }. One saved in binary, which starts
with TPF0 and which older projects keep, opens on the text Delphi's View as Text would
show: the objects nested, inherited and inline where they are, every property Name = value, sets in [ … ], lists in ( … ), collections in < … > and binary data as hex. F4
goes to the bytes, and back.
Programs. Shift+F11 on an .exe, .dll or .bpl built with Delphi or C++Builder has a
Delphi part: which of the two built it, the packages it needs, how many units it holds and
their names, and every form inside it by name and class. Enter on a form opens it as text,
as if it were its own .dfm.
Sources and projects. .pas, .dpr, .dpk, .lpr, .pp and .inc are coloured as
Pascal, with Delphi's own reserved words and directives as keywords in any case, $FF and
#13 as numbers, and {$…} directives apart from comments; a member after a dot —
E.Message — is a name, not the directive it is spelt like. A thin line runs down each
begin … end, try … end, case, repeat … until and declared class or record, as the
IDE draws it, and down each object … end of a form. A { … } of binary data in a form, or
any comment opened above the window, keeps its colour when its first line scrolls off. The
theme delphi-dark-2027 gives the whole program the IDE's dark colours.
Projects. .dproj, .groupproj and .cbproj are coloured as XML; .dof and .dsk as INI.
What the IDE leaves behind. The group <delphi> — *.~*, __history, __recovery,
*.dcu, *.identcache, *.local, *.dsk and the rest — is drawn dim, as temporary files
are, and Gray + with <delphi> selects it all for F8.