hawknewton/matrix-splash.nvim

github github
startup
stars 2
issues 0
subscribers 0
forks 0
CREATED

UPDATED


matrix-splash.nvim

A Matrix digital-rain splash screen for Neovim. Columns of half-width katakana, numerals, and Latin glyphs fall at three depths. A name of your choice decodes out of the code in the middle of the screen, and lines like "Wake up, Neo..." type out beneath it.

Demo

Press any key and the splash is gone. The key still does whatever it normally does.

  • Plays on nvim with no file arguments, and on :tabnew.
  • Full-screen float, with no dashboard, menu, or buffer left behind.
  • The name is configurable, or you can leave it out for rain only.
  • Lowercase is upper-cased. The font covers A-Z 0-9 and space - . ! ? _ '.
  • No dependencies.

Requirements

  • Neovim 0.10+
  • termguicolors (recommended)
  • A font that can show half-width katakana. On macOS the system fills them in automatically. Otherwise use glyphs = "binary".

Install

lazy.nvim:

{
  "hawknewton/matrix-splash.nvim",
  lazy = false, -- must load at startup to catch VimEnter
  opts = {
    name = "HAWK",
  },
}

If you use LazyVim, also turn off its dashboard:

{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } }

Other plugin managers: call require("matrix-splash").setup({ ... }) from your config at startup.

Configuration

These are the defaults. Pass only what you want to change.

require("matrix-splash").setup({
  -- Decoded in the middle. false or "" = rain only.
  name = "NEO",
  -- Typed under the title, looping. {name} -> the name in title case ("Neo" if no name).
  -- false or {} = no messages.
  messages = {
    "Wake up, {name}...",
    "The Matrix has you...",
    "Follow the white rabbit.",
    "Knock, knock, {name}.",
  },
  on_startup = true, -- `nvim` with no file args
  on_tabnew = true,  -- a new tab on an empty buffer
  -- "film" (katakana/numerals/Latin), "binary", or any string of single-cell chars
  glyphs = "film",
  -- bottom-right line: true (nvim version + lazy.nvim stats), false, a string,
  -- or a function returning a string
  footer = true,
  frame_ms = 60,
  zindex = 250,
  colors = {
    bg = "#000000",
    glow = "#021607",
    title_fg = "#c8ffc8",
    title_bg = "#0e6b22",
    flash_fg = "#ffffff",
    flash_bg = "#3fcf55",
    text = "#a8ffa8",
    footer = "#1e7a1e",
    rain = { -- head color, then 4 trail shades (exactly 5 each)
      near = { "#e8ffe8", "#5cff5c", "#33cc33", "#1e8a1e", "#0f4f0f" },
      mid = { "#8cff8c", "#2fb52f", "#1e7a1e", "#145214", "#0a2f0a" },
      far = { "#3a9a3a", "#1a5c1a", "#0f3d0f", "#0a2a0a", "#061a06" },
    },
  },
})

If the name is too wide for the window, it drops to a smaller scale. If it still won't fit, it's left out.

Commands and API

:MatrixSplash show it now
:MatrixSplash TRINITY show it once with a different name
:MatrixSplash! show it once with no name
require("matrix-splash").open(opts?) opts overrides config for one showing
require("matrix-splash").close()
require("matrix-splash").is_open()
:checkhealth matrix-splash checks version, termguicolors, font coverage for your name, and katakana width

Notes

  • In the film the glyphs are mirrored. Terminals can't mirror text, so here they run unmirrored.
  • The splash covers the whole editor, statusline and tabline included, and closes on any key or mouse input. Focus events are ignored.
  • It skips the splash for piped input (cmd | nvim -) and for :tabedit file.

Tests

nvim --headless -u NONE -l tests/smoke.lua

License

MIT