diff options
Diffstat (limited to 'packages/core/src/utils/editor.ts')
| -rw-r--r-- | packages/core/src/utils/editor.ts | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/packages/core/src/utils/editor.ts b/packages/core/src/utils/editor.ts index 174dae3e..ac83b409 100644 --- a/packages/core/src/utils/editor.ts +++ b/packages/core/src/utils/editor.ts @@ -12,12 +12,19 @@ export type EditorType = | 'windsurf' | 'cursor' | 'vim' + | 'neovim' | 'zed'; function isValidEditorType(editor: string): editor is EditorType { - return ['vscode', 'vscodium', 'windsurf', 'cursor', 'vim', 'zed'].includes( - editor, - ); + return [ + 'vscode', + 'vscodium', + 'windsurf', + 'cursor', + 'vim', + 'neovim', + 'zed', + ].includes(editor); } interface DiffCommand { @@ -43,6 +50,7 @@ const editorCommands: Record<EditorType, { win32: string; default: string }> = { windsurf: { win32: 'windsurf', default: 'windsurf' }, cursor: { win32: 'cursor', default: 'cursor' }, vim: { win32: 'vim', default: 'vim' }, + neovim: { win32: 'nvim', default: 'nvim' }, zed: { win32: 'zed', default: 'zed' }, }; @@ -97,8 +105,9 @@ export function getDiffCommand( case 'zed': return { command, args: ['--wait', '--diff', oldPath, newPath] }; case 'vim': + case 'neovim': return { - command: 'vim', + command, args: [ '-d', // skip viminfo file to avoid E138 errors @@ -172,7 +181,8 @@ export async function openDiff( }); }); - case 'vim': { + case 'vim': + case 'neovim': { // Use execSync for terminal-based editors const command = process.platform === 'win32' |
