Vi mode: add 's' (substitute) command

Resolved 💬 3 comments Opened Mar 29, 2026 by vbhavsar Closed May 29, 2026

Summary

Vi mode is missing the s command (substitute - delete character under cursor and enter insert mode). This is a commonly used vi command, essentially equivalent to cl or xi.

Current state

Vi mode has been steadily gaining commands across releases:

  • Basic motions and operators (c, d, w, b, e, etc.)
  • f/F/t/T with ; and , repeat
  • y/yy/Y, p/P (yank/paste)
  • Text objects (iw, aw, i", a", etc.)
  • >>, << (indent/dedent), J (join lines)
  • u (undo)

The s command is not currently supported. Neither is S (substitute entire line, equivalent to cc).

Expected behavior

  • s in normal mode: delete character under cursor and enter insert mode
  • S in normal mode: delete entire line contents and enter insert mode (same as cc)
  • Both should support count prefixes (e.g., 3s deletes 3 characters and enters insert mode)

Why

s is muscle memory for many vim users - it's one of the most common single-char editing commands. Its absence breaks flow when editing prompts.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗