strop

Start

Coming from Neovim

Neovim with no configuration (nvim -u NONE) is strop's specification for keys: the same keys should leave the same text, cursor and registers. This page says where that holds, where strop does something else on purpose, and what is not there.

What works

The everyday editing language is there, and it is checked against Neovim rather than against memory:

  • Operators with every motion and text object, with and without a count, in Normal and Visual, and repeated with .. That includes gU gu g~ g? !, the ip it gn objects, and v / V between an operator and its motion.
  • Registers by Vim's rules: "0, "1–"9, "-, "A to append, "_, the read-only ones, and macros as register content. Ctrl-R pastes a register in every text field, not only in Insert mode.
  • Marks, the jump list and the change list; character, line and block Visual; Ctrl-A / Ctrl-X; Replace mode.
  • The : line with Vim's ranges and abbreviations: :s with &, \1 and the c flag, :g, :v, :norm, :m, :t, :d, :y, :sort, :b, :ls, :wa, :cd.
  • Window commands on Ctrl-W, tab pages (gt, :tab split, Ctrl-W T), quickfix commands (:copen, :cnext, :cdo, :cfdo), and a terminal that behaves like Neovim's, down to Ctrl-\ Ctrl-N.

How it is checked: before a release, about 4,000 key sequences are typed into both editors and the resulting text, cursor, mode and registers are compared. The few cases where strop knowingly differs are listed with a reason; everything else has to match. More on that.

The full keymap is generated from the binary's command table, by section:

What differs

These are deliberate.

  • No configuration language and no plugins. There is no init.lua, no Vimscript and no plugin manager. What plugins usually add is in the binary. strop config prints the handful of settings there are.
  • Space is the leader, and its keys are fixed. Space f finds files, Space / searches, Space g is git. Space ? lists them all. You cannot remap keys yet.
  • Search is smart-case. /edge finds Edge; a capital letter in the pattern makes case count, and \c / \C decide outright. :s is case-sensitive, as in Vim.
  • A plain yank reaches the system clipboard. y with no register also copies; deletes, changes and named registers do not.
  • The project is the directory you started in. It does not follow the current file. :cd changes it.
  • Language-server keys follow Neovim 0.11: grr references, grn rename. gd asks the language server instead of searching the buffer.
  • Two commands show their range while you type them: d/pattern highlights what it will delete until you press Enter, and :s shows the changed lines before and after.

Keys that do something else

Neovim binds these; strop uses the key for something different.

  • Normal: space — Neovim: move right. strop: the leader.
  • Normal: Q — Neovim: replay the last recorded register. strop: plant a cursor that stays while motions move the main one; Esc ends planting (@@ replays).
  • Normal: gd gD — Neovim: go to the local or global declaration by search. strop: language-server definition and declaration.
  • Normal: gI — Neovim: insert in column 1. strop: language-server implementation.
  • Normal: gr — Neovim: replace with a virtual character (gr{char}). strop: only the prefix of the language-server keys grr grn gra gri.
  • Normal: gs — Neovim: sleep. strop: switch between source and header.
  • Normal: m — Neovim: set a mark. strop: the match prefix (ms mr md add, replace and delete a surrounding pair, mm the matching bracket, mi ma select inside and around); marks are set with gm.
  • Normal: gm — Neovim: go to the middle of the screen line. strop: set a mark (gm{a-z}); ' and ` jump to it.
  • Visual: m — Neovim: set a mark. strop: the match prefix (ms wraps the selection, mi ma select an object); marks are set with gm.
  • Visual: ctrl-c — Neovim: leave Visual. strop: toggle comments on the selected lines (Esc leaves).
  • Insert: ctrl-e ctrl-y — Neovim: insert the character below or above. strop: dismiss or accept the completion menu.

What is missing

Beyond plugins and scripting, these Neovim keys do nothing in strop. An operator on the list (=, gq, gw, zf) still takes its motion and then says it is not supported, so the motion's keys never run as commands by accident.

  • Normal: zfj zo zc za zR zM zj zk zd — folds
  • Normal: U — undo every change on the line
  • Normal: == =j =ip — the reindent operator
  • Normal: gqq gqip gwip — reflow text to the text width
  • Normal: dis das — the sentence text objects
  • Normal: ga g8 — show the character under the cursor as a code
  • Normal: gx gf gF — open the URL or file name under the cursor
  • Normal: gR — virtual replace mode
  • Normal: K — look the word under the cursor up (hover is space k)
  • Normal: ][ [] ]m [m — section-end and method motions
  • Normal: z= zg ]s [s — spelling
  • Normal: gM go — middle of the line, byte offset
  • Normal: zh zl zH zL ze zs — horizontal scrolling
  • Normal: do dp — diff mode
  • Normal: ctrl-w x ctrl-w r ctrl-w H ctrl-w J ctrl-w K ctrl-w L ctrl-w + ctrl-w - ctrl-w _ ctrl-w | — move, rotate and resize windows (panes are always equal)
  • Visual: = gq gw zf — reindent, reflow and fold the selection
  • Insert: ctrl-v ctrl-k ctrl-a — insert a literal key, a digraph, the last inserted text
  • Ex: :fold :mksession :digraphs — folds, session files, digraphs
  • Ex: :tabs :tabdo :tabfind :tcd — list tab pages, run a command in each, find into one, a directory per tab page

Also not there: key remapping, autocommands, folds, spell checking, digraphs, diff mode, and builds for anything but Linux and WSL on x86_64. If one of these is what you live in, strop is not ready for you yet.

The section list and the lists of missing and reassigned keys on this page are generated from docs/vim-compat.md at v0.80.0, which the binary prints with strop compat.