Files
gemini-cli/packages/cli/src/ui/commands/vimCommand.ts

28 lines
643 B
TypeScript
Raw Normal View History

2025-07-25 15:36:42 -07:00
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { SlashCommand } from './types.js';
import { CommandKind } from './types.js';
2025-07-25 15:36:42 -07:00
export const vimCommand: SlashCommand = {
name: 'vim',
description: 'Toggle vim mode on/off',
2025-07-25 15:36:42 -07:00
kind: CommandKind.BUILT_IN,
autoExecute: true,
2025-07-25 15:36:42 -07:00
action: async (context, _args) => {
const newVimState = await context.ui.toggleVimEnabled();
const message = newVimState
? 'Entered Vim mode. Run /vim again to exit.'
: 'Exited Vim mode.';
return {
type: 'message',
messageType: 'info',
content: message,
};
},
};