Repository navigation
Releases: Orpheus-21/lazytypst
Releases · Orpheus-21/lazytypst
Release list
lazytypst 0.1.0
The first version. It needs Typst 0.12.0 or later in PATH, and it is tested with Typst 0.15.1. It needs Rust 1.90 or later to build. It is tested on Linux, with the kitty image protocol in Ghostty and with half blocks. The sixel and iTerm2 protocols are not tested.
Added
- A list of the
.typfiles in a folder, up to three folders deep. Hidden folders are skipped. - A folder with exactly one
.typfile opens that file in the editor at start.Escshows the list. - Keys in the list:
jandkor the arrow keys,gandGorHomeandEnd,Enterto open a file, andqto quit. /filters the list while you type. The match ignores case.Escremoves the filter.rreads the folder again, to show new files and to drop deleted files.nmakes a new.typfile from a path such aschapters/two. The program makes missing folders and refuses a name that leaves the project.- The list selects the file that you closed last time in the folder. Opening it shows the page of the preview that was open. The program keeps this outside the project folder.
sswitches the order of the list between the path and the newest change first.- Each line of the list shows the time since the last change, such as
2 h. A narrow terminal hides the ages. ein the list edits the selected file inVISUALorEDITOR, and then opens it with a compile.Ein the list exports the PDF of the selected file.ycopies the absolute path of the selected file to the system clipboard.mmarks a main file. The live compile,Ctrl-B, andCtrl-Ethen use the main file, whatever file you edit. The program remembers the main file of each project, and it keeps that choice outside the project folder.- A folder or a
.typfile as the argument. A file opens in the editor at once, and its folder is the project root. Files in subfolders can import files from parent folders inside the root. Left,Right,Backspace, andDeletework on one visible character, such as a Devanagari conjunct or an emoji with joiners.- The status line shows an approximate word count. It skips comments, math, and lines of code such as
#setand#import. - Syntax color in the editor for headings, commands after
#, strings in code, math, raw text, and comments. The colors come from the terminal palette. - A text area with line numbers, long lines that wrap, and Emacs style editing keys.
Tabinserts 2 spaces. The status line shows the cursor asline:column. If you close a file and open it again, the cursor comes back. - A compile starts when a file opens, so the preview shows at once.
- An autosave 300 ms after the last key, and a live compile after each save. A new compile stops the compile that still runs.
- A reload of the file when another program changes it and the text has no edits. The cursor keeps its line, and a compile starts.
- A safe save. The program writes the file only when the text has edits. It does not overwrite a change that another program made, until you press
Ctrl-S. It writes a temp file and renames it, so a crash cannot cut the file. A symlink stays a symlink, and the permissions stay. - A paste arrives as one piece. A long paste is fast, one undo takes it back, and a tab character in it stays a tab character.
- A live preview of the document as an image next to the editor. The program uses the kitty, sixel, or iTerm2 image protocol when the terminal has one, and half block characters if not.
- The preview renders only the page on screen, so a long document stays fast. In a release build, a book of 500 pages shows its page after 0.7 s.
Alt-Down,Alt-Up,Alt-Home, andAlt-Endchange the page. The title of the preview shows the page and the page count. If the document gets shorter than the page on screen, the preview shows the last page.- The program honors
NO_COLOR. Text and borders have no color, and an error line is bold. The preview image keeps its colors. F11shows the preview on the full screen. There,+,-, and0zoom, and the arrow keys move the view of a zoomed page. Typing does nothing there.- A compile pane under the editor. It shows the errors with their line numbers, the time of the compile, and the number of errors and warnings. Errors are red, warnings are yellow, and hints are dim. If the report does not fit, the last row says how many rows are hidden.
Ctrl-Oopens the last exported PDF withxdg-open.Ctrl-Qsaves the file and quits the program from the editor.Ctrl-CandCtrl-Xalso put the selected text on the system clipboard, with the OSC 52 escape sequence.F5turns the live compile off and on. The autosave stays on.Ctrl-Fsearches with a regular expression.EnterorCtrl-Fgoes to the next match, and the search wraps.Esccloses the prompt.Ctrl-Gmoves the cursor to the first error of the last compile. If the error is in another file of the project, it opens that file at the error. An error in a package file is only named.Ctrl-Bcompiles at once, andCtrl-Eexports a PDF next to the file that was compiled.- The title of the terminal window names the folder or the open file.
--doctorchecks the Typst program, the image protocol of the terminal, and the temporary folder, and prints one line for each.?in the list andF1in the list and the editor open a help window with all keys.Enteron a line presses the key of that line.- The help text and the README list the editing keys of the text area.
- A man page,
docs/lazytypst.1. A test keeps its keys the same as the help text. --helpprints the keys.--versionprints the version of lazytypst and the version of Typst.- The variable
LAZYTYPST_TYPSTnames the Typst program instead oftypst. - A clear message and exit code 1 when the
typstcommand is missing. The program checks this before it draws anything. - Safety with projects from other people: the list shows regular files only, an export never writes through a link, a compile stops after 60 seconds, and the memory of Typst is limited if
prlimitis installed. - A warning when the project has a link that points outside it. No compile starts at open then.
- A file with CRLF line ends keeps them after a save.
- A temporary folder that only your user can open. The program deletes it when it ends, and the next start deletes folders that an earlier run left behind.