Skip to content
/
Try

Sessions, folding and sticky scroll in Skink

Fold a block, fold everything, open it all again.

Run skink with no arguments inside a project and it reopens what you had when you last quit there: files, cursors, split panes, the file tree and shells.

For folding, press Alt+M (or :fold) to fold or unfold the block at the cursor, and Alt+Shift+M (or :unfoldall) to open every fold.

A project is a folder with .git, Cargo.toml, package.json, go.mod, pyproject.toml or build.zig, or any folder below one. Running skink with no arguments there restores:

  • the open files and their cursors
  • split panes
  • the file tree and its open folders
  • shells, started again in their last folder (programs that were running in them are not restarted)
  • extra roots added with :addroot

Opening a specific file or folder (skink src/main.rs, skink .) starts fresh and does not overwrite the saved session. So you can do a quick edit without losing your setup.

{ "restoresession": false }

Separate from sessions, Skink backs up unsaved edits after a 3 second pause. If Skink or the terminal crashes, opening the file again offers (r)ecover or (d)iscard.

Folding works by indentation, so it works in any language.

Key Typed command Does
Alt+M :fold Fold or unfold the block at the cursor
:foldall Fold every top-level block
Alt+Shift+M :unfoldall Open every fold

A closed fold shows a mark in the gutter (click it to open the fold) and “N lines” after its first line.

The cursor steps over a closed fold. Jumping into one, with search or go to line, opens it.

The headers of the blocks you are scrolled into (the function, the impl, the class) stay pinned at the top of the editor. Click one to jump to it.

Turn it off with:

{ "stickyscroll": false }

Draw vertical lines at given columns:

{ "rulers": [80, 100] }

Micro’s "colorcolumn": 80 works too.

Skink remembers where you were before a jump: go to definition, a result, quick open, :goto.

Key Typed command Does
Alt+U :back Back to where you were before the jump
Alt+Shift+U :forward Forward again

The scrollbar in the editor’s last column marks, across the whole file:

  • errors (red)
  • warnings (yellow)
  • find matches (orange)
  • the cursor (blue)

:addroot DIR adds another folder below the main root in the file tree. Quick open and project search cover it too, and the session remembers it.

:removeroot [DIR] removes it again. Without an argument it removes the one selected in the tree.