LEAN

Use

Notepad and downloads

A notepad beside the page, and downloads sorted by project.

The notepad

gn (or :note) opens a notepad at the right edge of the window and puts the cursor in it. The text is one plain file, saved a second after the last change and when the notepad closes or Lean quits.

  • The file is notes.md in the config folder, or the one named by noteFile. Put it into an Obsidian vault and it is an ordinary note there; with date codes (~/Vault/Daily/%Y-%m-%d.md) you get one note a day.
  • The file can be edited elsewhere too. The notepad reads it again when it gets the keys, unless something typed here is still unsaved.
  • Nothing is read or built before the notepad is first opened.

It has a small set of Vim keys. It is an imitation, not Vim: one register (the system clipboard), no counts, no text objects.

Keys Action
h j k l w b 0 $ gg Gmove
i a I A o Oinsert mode; Esc returns to normal mode
x dd D yy p Pdelete, yank, paste; a yanked line is pasted as a line
u <C-r>undo, redo
v Vselect; then y, d or x
Esc in normal modeback to the page; the notepad stays open and gn returns to it
qclose the notepad

While the notepad has the keys, its mode is shown above the text. These keys are fixed; only gn can be rebound.

Downloads

What a page cannot show is downloaded. The file goes to a folder named after the tab's project group inside Downloads (~/Downloads/Shop/), under a free name; tabs outside a project download to Downloads itself. The status line names the file when it is done.

  • downloadsByGroup turns the sorting off; downloads on a project gives it a folder of its own.
  • Pictures and PDFs open in the tab, as in every browser. gS (or :save) downloads what the tab shows, with the tab's cookies.
  • On the Mac a download is marked as coming from the internet, so macOS checks it before it first opens.

The list of downloads

gf (or :downloads) lists past downloads, newest first, with group, age and site. Typing filters the list.

Keys Action
Enteropen the file
Cmd+Enter (Linux: Ctrl+Enter)show it in Finder or the file manager
Shift+Enteropen the page it came from in a new tab
Option+Enter (Linux: Alt+Enter)copy its path

The list keeps the last 300 downloads in a file only you can read. Deleting that file empties the list, not the folders.