File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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" ;
2222import " @vimee/shiki-editor/styles.css" ;
2323import { createHighlighter } from " shiki" ;
2424
@@ -30,7 +30,7 @@ const highlighter = await createHighlighter({
3030
3131function 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
9696import {
97- VimEditor ,
97+ Vim ,
9898 Cursor ,
9999 Line ,
100100 StatusLine ,
Original file line number Diff line number Diff line change 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.
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 *
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";
3535import { Cursor } from "./components/Cursor" ;
3636import { 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
Original file line number Diff line number Diff line change 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
1212import { describe , it , expect } from "vitest" ;
13- import { computeSelectionInfo } from "../VimEditor " ;
13+ import { computeSelectionInfo } from "../Vim " ;
1414import { splitTokenBySelection } from "../components/Line" ;
1515import type { ThemedToken } from "shiki" ;
1616
Original file line number Diff line number Diff line change 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 *
1414 * langs: ['typescript'],
1515 * })
1616 *
17- * <VimEditor
17+ * <Vim
1818 * content={code}
1919 * highlighter={highlighter}
2020 * lang="typescript"
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
3434export { useShikiTokens } from "./hooks/useShikiTokens" ;
You canβt perform that action at this time.
0 commit comments