Skip to main content

visual

Function visual 

Source
pub fn visual(
    key: KeyEvent,
    ctx: &mut InputCtx,
    state: &AppState,
) -> Option<Action>
Expand description

Translates a KeyEvent in Visual Mode into an Action.

Visual mode shares Navigation Mode’s bindings — j, k, G, gg and the arrows move exactly as they do there, which is what extends the range — and reinterprets the few that end it:

  • Space and v add the range to the marks;
  • h/l (and the other ways of leaving the directory) add it and then go;
  • Esc abandons it, leaving the marks as they were;
  • dd deletes it, after one confirmation.

Everything else is ignored: a yank or a paste in the middle of selecting is more likely a slip than a request.