:right-sidebar: True VimIMContext =================================================================== .. currentmodule:: gi.repository.GtkSource .. versionadded:: 5.4 .. class:: VimIMContext(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.IMContext`, :class:`~gi.repository.GObject.Object` :Constructors: :: VimIMContext(**properties) new() -> Gtk.IMContext Constructors ------------ .. rst-class:: interim-class .. class:: VimIMContext :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.IMContext Methods ------- .. rst-class:: interim-class .. class:: VimIMContext :no-index: .. method:: execute_command(command: str) -> None Executes ``command`` as if it was typed into the command bar by the user except that this does not emit the :obj:`~gi.repository.GtkSource.VimIMContext.signals.execute_command` signal. .. versionadded:: 5.4 :param command: the command text .. method:: get_command_bar_text() -> str Gets the current command-bar text as it is entered by the user. .. versionadded:: 5.4 .. method:: get_command_text() -> str Gets the current command text as it is entered by the user. .. versionadded:: 5.4 Properties ---------- .. rst-class:: interim-class .. class:: VimIMContext :no-index: .. attribute:: props.command_bar_text :type: str .. attribute:: props.command_text :type: str Signals ------- .. rst-class:: interim-class .. class:: VimIMContext.signals :no-index: .. method:: edit(view: ~gi.repository.GtkSource.View, path: str | None = None) -> None Requests the application open the file found at ``path``. If ``path`` is :const:`None`, then the current file should be reloaded from storage. This may be executed in relation to the user running the ``:edit`` or ``:e`` commands. .. versionadded:: 5.4 :param view: the :obj:`~gi.repository.GtkSource.View` :param path: the path if provided, otherwise :const:`None` .. method:: execute_command(command: str) -> bool The signal is emitted when a command should be executed. This might be something like ``:wq`` or `:e `. If the application chooses to implement this, it should return :const:`True` from this signal to indicate the command has been handled. .. versionadded:: 5.4 :param command: the command to execute .. method:: format_text(begin: ~gi.repository.Gtk.TextIter, end: ~gi.repository.Gtk.TextIter) -> None Requests that the application format the text between ``begin`` and ``end``. .. versionadded:: 5.4 :param begin: the start location :param end: the end location .. method:: write(view: ~gi.repository.GtkSource.View, path: str | None = None) -> None Requests the application save the file. If a filename was provided, it will be available to the signal handler as ``path``. This may be executed in relation to the user running the ``:write`` or ``:w`` commands. .. versionadded:: 5.4 :param view: the :obj:`~gi.repository.GtkSource.View` :param path: the path if provided, otherwise :const:`None`