Skip to content

Commit 8014f3e

Browse files
committed
refactor(shiki-editor): rename VimEditor to Vim
Rename component VimEditor β†’ Vim, interface VimEditorProps β†’ VimProps, file VimEditor.tsx β†’ Vim.tsx, test file accordingly. Update all imports, exports, comments, and README.
1 parent 229881b commit 8014f3e

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

β€Žpackages/shiki-editor/README.mdβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ npm install @vimee/core @vimee/react @vimee/shiki-editor shiki
1818
## Quick Start
1919

2020
```tsx
21-
import { VimEditor } from "@vimee/shiki-editor";
21+
import { Vim } from "@vimee/shiki-editor";
2222
import "@vimee/shiki-editor/styles.css";
2323
import { createHighlighter } from "shiki";
2424

@@ -30,7 +30,7 @@ const highlighter = await createHighlighter({
3030

3131
function App() {
3232
return (
33-
<VimEditor
33+
<Vim
3434
content={`const greeting = "Hello, vim!";`}
3535
highlighter={highlighter}
3636
lang="typescript"
@@ -42,7 +42,7 @@ function App() {
4242
}
4343
```
4444

45-
## `<VimEditor />` Props
45+
## `<Vim />` Props
4646

4747
| Prop | Type | Default | Description |
4848
|------|------|---------|-------------|
@@ -94,7 +94,7 @@ All sub-components are exported for building custom editor layouts:
9494

9595
```tsx
9696
import {
97-
VimEditor,
97+
Vim,
9898
Cursor,
9999
Line,
100100
StatusLine,
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* VimEditor.tsx
2+
* Vim.tsx
33
*
44
* Main React component for the @vimee/shiki-editor package.
55
* Provides a syntax-highlighted code editor with Vim keybindings.
@@ -8,7 +8,7 @@
88
*
99
* @example
1010
* ```tsx
11-
* import { VimEditor } from '@vimee/shiki-editor'
11+
* import { Vim } from '@vimee/shiki-editor'
1212
* import '@vimee/shiki-editor/styles.css'
1313
* import { createHighlighter } from 'shiki'
1414
*
@@ -17,7 +17,7 @@
1717
* langs: ['typescript'],
1818
* })
1919
*
20-
* <VimEditor
20+
* <Vim
2121
* content={code}
2222
* highlighter={highlighter}
2323
* lang="typescript"
@@ -35,8 +35,8 @@ import { Line } from "./components/Line";
3535
import { Cursor } from "./components/Cursor";
3636
import { StatusLine } from "./components/StatusLine";
3737

38-
/** Props for the VimEditor component */
39-
export interface VimEditorProps {
38+
/** Props for the Vim component */
39+
export interface VimProps {
4040
/** Initial content */
4141
content: string;
4242
/** Shiki Highlighter instance */
@@ -74,12 +74,12 @@ export interface VimEditorProps {
7474
}
7575

7676
/**
77-
* VimEditor component.
77+
* Vim component.
7878
*
7979
* Displays code using Shiki's highlighter
8080
* with Vim keybindings for editing.
8181
*/
82-
export function VimEditor({
82+
export function Vim({
8383
content: initialContent,
8484
highlighter,
8585
lang,
@@ -97,7 +97,7 @@ export function VimEditor({
9797
indentStyle,
9898
indentWidth,
9999
showLineNumbers = true,
100-
}: VimEditorProps) {
100+
}: VimProps) {
101101
const containerRef = useRef<HTMLDivElement>(null);
102102
const codeAreaRef = useRef<HTMLDivElement>(null);
103103

packages/shiki-editor/src/__tests__/VimEditor.test.tsx renamed to packages/shiki-editor/src/__tests__/Vim.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
*/
44

55
/**
6-
* VimEditor.test.tsx
6+
* Vim.test.tsx
77
*
8-
* Tests for the VimEditor component and helper functions.
8+
* Tests for the Vim component and helper functions.
99
* Uses a mock Shiki highlighter to avoid loading real grammars.
1010
*/
1111

1212
import { describe, it, expect } from "vitest";
13-
import { computeSelectionInfo } from "../VimEditor";
13+
import { computeSelectionInfo } from "../Vim";
1414
import { splitTokenBySelection } from "../components/Line";
1515
import type { ThemedToken } from "shiki";
1616

β€Žpackages/shiki-editor/src/index.tsβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @example
77
* ```tsx
8-
* import { VimEditor } from '@vimee/shiki-editor'
8+
* import { Vim } from '@vimee/shiki-editor'
99
* import '@vimee/shiki-editor/styles.css'
1010
* import { createHighlighter } from 'shiki'
1111
*
@@ -14,7 +14,7 @@
1414
* langs: ['typescript'],
1515
* })
1616
*
17-
* <VimEditor
17+
* <Vim
1818
* content={code}
1919
* highlighter={highlighter}
2020
* lang="typescript"
@@ -24,11 +24,11 @@
2424
*/
2525

2626
// Main component
27-
export { VimEditor } from "./VimEditor";
28-
export type { VimEditorProps } from "./VimEditor";
27+
export { Vim } from "./Vim";
28+
export type { VimProps } from "./Vim";
2929

3030
// Helper exports for custom implementations
31-
export { computeSelectionInfo } from "./VimEditor";
31+
export { computeSelectionInfo } from "./Vim";
3232

3333
// Hooks
3434
export { useShikiTokens } from "./hooks/useShikiTokens";

0 commit comments

Comments
Β (0)