code: def test_vi_cursor_movements():
      """
      Test cursor movements with Vi key bindings.
      """
      feed = partial(_feed_cli_with_input, editing_mode=EditingMode.VI)
  
      result, cli = feed("\x1b\r")
      assert result.text == ""
      assert cli.editing_mode == EditingMode.VI
  
      # Esc h a X
      result, cli = feed("hello\x1bhaX\r")
      assert result.text == "hellXo"
  
      # Esc I X
      result, cli = feed("hello\x1bIX\r")
      assert result.text == "Xhello"
  
      # Esc I X
      result, cli = feed("hello\x1bIX\r")
      assert result.text == "Xhello"
  
      # Esc 2hiX
      result, cli = feed("hello\x1b2hiX\r")
      assert result.text == "heXllo"
  
      # Esc 2h2liX
      result, cli = feed("hello\x1b2h2liX\r")
      assert result.text == "hellXo"
  
      # Esc \b\b
      result, cli = feed("hello\b\b\r")
      assert result.text == "hel"
  
      # Esc \b\b
      result, cli = feed("hello\b\b\r")
      assert result.text == "hel"
  
      # Esc 2h D
      result, cli = feed("hello\x1b2hD\r")
      assert result.text == "he"
  
      # Esc 2h rX \r
      result, cli = feed("hello\x1b2hrX\r")
      assert result.text == "heXlo"
  
imports: from __future__ import annotations
  from functools import partial
  import pytest
  from prompt_toolkit.clipboard import ClipboardData, InMemoryClipboard
  from prompt_toolkit.enums import EditingMode
  from prompt_toolkit.filters import ViInsertMode
  from prompt_toolkit.history import InMemoryHistory
  from prompt_toolkit.input.defaults import create_pipe_input
  from prompt_toolkit.input.vt100_parser import ANSI_SEQUENCES
  from prompt_toolkit.key_binding.bindings.named_commands import prefix_meta
  from prompt_toolkit.key_binding.key_bindings import KeyBindings
  from prompt_toolkit.output import DummyOutput
  from prompt_toolkit.shortcuts import PromptSession
label_desc: Use image node_id 23 for calling a global function with example usage: test_vi_cursor_movements() without return types