Skip to content

Instantly share code, notes, and snippets.

@darcyparker
Last active February 6, 2026 03:13
Show Gist options
  • Select an option

  • Save darcyparker/1886716 to your computer and use it in GitHub Desktop.

Select an option

Save darcyparker/1886716 to your computer and use it in GitHub Desktop.
Vim Modes Transition Diagram in SVG https://rawgithub.com/darcyparker/1886716/raw/eab57dfe784f016085251771d65a75a471ca22d4/vimModeStateDiagram.svg Note, most of the nodes in this graph have clickable hyperlinks to documentation.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AltitudeApps
Copy link

'd' and 'y' appear to be missing, but I'm assuming that it is intended that the lozenge labeled 'operator' is intended to cover these cases.

Is there a key or additional information which further defines these, perhaps enumerating the possible cases? For the 'Printable Character, NL or CR', but a list of known operators would be quite helpful for the learner.

What I've been looking for is some sort of state machine description or transition diagram or table which delineates valid normal mode commands. Meaning, those which end up either modifying the buffer, or end up with a value landing in a register, something like that. This is as opposed to a sequence of keystrokes that are nonsensical, and end up being ignored and dumping you right back to normal mode with no pending commands being authored. For instance, dm appears to be meaningless, and just results in landing back in normal mode as if you hadn't pressed any keys at all.

Another case of interest to me is something like dvvvvvvvvvvvvj, which seems to be equivalent to dvj. I'm not sure why this would be allowed, but it is.

Maybe the information I'm looking for is present, and I'm just not seeing it?

@darcyparker
Copy link
Author

darcyparker commented Feb 6, 2026

@AltitudeApps

'd' and 'y' appear to be missing, but I'm assuming that it is intended that the lozenge labeled 'operator' is intended to cover these cases.

These are not commands that transition modes. d and y are for delete and yank respectively and you start and end in normal mode. That's why they aren't there. It's sometimes a misunderstanding, but this diagram was about mode transitions only.

What I've been looking for is some sort of state machine description or transition diagram or table which delineates valid normal mode commands. Meaning, those which end up either modifying the buffer, or end up with a value landing in a register, something like that. This is as opposed to a sequence of keystrokes that are nonsensical, and end up being ignored and dumping you right back to normal mode with no pending commands being authored. For instance, dm appears to be meaningless, and just results in landing back in normal mode as if you hadn't pressed any keys at all.

It's possible to create a bigger state machine diagram for additional keystrokes. But it would be too large. Perhaps AI can help build the graph as an adjacency matrix. But I think you'd want to cull it down into different views and render them separately.

Another case of interest to me is something like dvvvvvvvvvvvvj, which seems to be equivalent to dvj. I'm not sure why this would be allowed, but it is.

d is delete, j is down. v is changing the delete from line wise to character wise (starting from column you are in). Your string of multiple v is even number, so you're going to character wise, line wise, multiple times... and you're back to where you started. If you're in column 0, v has no effect...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment