This commit is contained in:
Sijie Wang 2025-07-25 15:36:42 -07:00 committed by GitHub
parent aa71438684
commit fbdc8d5ab3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 5324 additions and 191 deletions

View file

@ -0,0 +1,25 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { CommandKind, SlashCommand } from './types.js';
export const vimCommand: SlashCommand = {
name: 'vim',
description: 'toggle vim mode on/off',
kind: CommandKind.BUILT_IN,
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,
};
},
};