MCPcopy Create free account
hub / github.com/codeaashu/claude-code / call

Function call

src/commands/vim/vim.ts:8–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6import { getGlobalConfig, saveGlobalConfig } from '../../utils/config.js'
7
8export const call: LocalCommandCall = async () => {
9 const config = getGlobalConfig()
10 let currentMode = config.editorMode || 'normal'
11
12 // Handle backward compatibility - treat 'emacs' as 'normal'
13 if (currentMode === 'emacs') {
14 currentMode = 'normal'
15 }
16
17 const newMode = currentMode === 'normal' ? 'vim' : 'normal'
18
19 saveGlobalConfig(current => ({
20 ...current,
21 editorMode: newMode,
22 }))
23
24 logEvent('tengu_editor_mode_changed', {
25 mode: newMode as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
26 source:
27 'command' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
28 })
29
30 return {
31 type: 'text',
32 value: `Editor mode set to ${newMode}. ${
33 newMode === 'vim'
34 ? 'Use Escape key to toggle between INSERT and NORMAL modes.'
35 : 'Using standard (readline) keyboard bindings.'
36 }`,
37 }
38}
39
40

Callers

nothing calls this directly

Calls 3

getGlobalConfigFunction · 0.85
saveGlobalConfigFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected