VimIMContext

Added in version 5.4.

class VimIMContext(**properties: Any)

Superclasses: IMContext, Object

Constructors:

VimIMContext(**properties)
new() -> Gtk.IMContext

Constructors

class VimIMContext
classmethod new() IMContext

Methods

class VimIMContext
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 execute_command signal.

Added in version 5.4.

Parameters:

command – the command text

get_command_bar_text() str

Gets the current command-bar text as it is entered by the user.

Added in version 5.4.

get_command_text() str

Gets the current command text as it is entered by the user.

Added in version 5.4.

Properties

class VimIMContext
props.command_bar_text: str
props.command_text: str

Signals

class VimIMContext.signals
edit(view: View, path: str | None = None) None

Requests the application open the file found at path.

If path is 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.

Added in version 5.4.

Parameters:
  • view – the View

  • path – the path if provided, otherwise None

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 True from this signal to indicate the command has been handled.

Added in version 5.4.

Parameters:

command – the command to execute

format_text(begin: TextIter, end: TextIter) None

Requests that the application format the text between begin and end.

Added in version 5.4.

Parameters:
  • begin – the start location

  • end – the end location

write(view: 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.

Added in version 5.4.

Parameters:
  • view – the View

  • path – the path if provided, otherwise None