execute method
Execute the command.
Implementation
@override
Future<CommandResult> execute(String args, ToolUseContext context) async {
if (args.trim() == 'on') {
onVimToggle(true);
return const TextCommandResult('Vim mode enabled.');
}
if (args.trim() == 'off') {
onVimToggle(false);
return const TextCommandResult('Vim mode disabled.');
}
final current = isVimMode();
final newState = !current;
onVimToggle(newState);
return TextCommandResult('Vim mode ${newState ? "enabled" : "disabled"}.');
}