vim-sim 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -44
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# vim-sim
|
|
2
2
|
|
|
3
|
-
[](https://vim.colefoster.ca/demo)
|
|
4
4
|
[](https://www.npmjs.com/package/vim-sim)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
@@ -89,7 +89,8 @@ console.log(currentState.cursor.line); // 0
|
|
|
89
89
|
console.log(currentState.cursor.column); // 7
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
<details>
|
|
93
|
+
<summary><strong>API Documentation</strong></summary>
|
|
93
94
|
|
|
94
95
|
### Session
|
|
95
96
|
|
|
@@ -206,7 +207,10 @@ enum Mode {
|
|
|
206
207
|
}
|
|
207
208
|
```
|
|
208
209
|
|
|
209
|
-
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
<details>
|
|
213
|
+
<summary><strong>Usage Examples</strong></summary>
|
|
210
214
|
|
|
211
215
|
### Basic Text Editing
|
|
212
216
|
|
|
@@ -363,7 +367,10 @@ console.log(session.getState().buffer.content);
|
|
|
363
367
|
// "Copy this text\nPaste here\nCopy this text"
|
|
364
368
|
```
|
|
365
369
|
|
|
366
|
-
|
|
370
|
+
</details>
|
|
371
|
+
|
|
372
|
+
<details>
|
|
373
|
+
<summary><strong>Advanced Usage</strong></summary>
|
|
367
374
|
|
|
368
375
|
### Custom Configuration
|
|
369
376
|
|
|
@@ -421,6 +428,8 @@ const windowManager = state.windowManager;
|
|
|
421
428
|
const activeWindow = windowManager.getActiveWindow();
|
|
422
429
|
```
|
|
423
430
|
|
|
431
|
+
</details>
|
|
432
|
+
|
|
424
433
|
## TypeScript Support
|
|
425
434
|
|
|
426
435
|
This package is written in TypeScript and provides full type definitions.
|
|
@@ -437,43 +446,3 @@ function processVimState(state: State): void {
|
|
|
437
446
|
}
|
|
438
447
|
```
|
|
439
448
|
|
|
440
|
-
## Testing
|
|
441
|
-
|
|
442
|
-
The vim-sim package has 85%+ test coverage with over 1700 passing tests.
|
|
443
|
-
|
|
444
|
-
```bash
|
|
445
|
-
# Run tests
|
|
446
|
-
npm test
|
|
447
|
-
|
|
448
|
-
# Run tests in watch mode
|
|
449
|
-
npm run test:watch
|
|
450
|
-
|
|
451
|
-
# Type check
|
|
452
|
-
npm run typecheck
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
## Performance
|
|
456
|
-
|
|
457
|
-
- **Immutable State**: All state updates return new state objects
|
|
458
|
-
- **Efficient Algorithms**: O(1) undo/redo, efficient text manipulation
|
|
459
|
-
- **Small Bundle**: Tree-shakeable ES modules
|
|
460
|
-
- **No DOM Dependencies**: Pure Node.js/TypeScript implementation
|
|
461
|
-
|
|
462
|
-
## Browser Support
|
|
463
|
-
|
|
464
|
-
While designed for Node.js, vim-sim works in browsers with a bundler:
|
|
465
|
-
|
|
466
|
-
```bash
|
|
467
|
-
npm install vim-sim
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
```typescript
|
|
471
|
-
import { Session } from 'vim-sim';
|
|
472
|
-
|
|
473
|
-
const session = new Session();
|
|
474
|
-
// Use in your web application
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
## Acknowledgments
|
|
478
|
-
|
|
479
|
-
This project implements Vim's behavior as closely as possible to the original Vim editor by Bram Moolenaar.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vim-sim",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "A complete Vim editor simulation engine for Node.js. Implements motions, operators, visual mode, text objects, macros, marks, undo/redo tree, spell checking, and more. \
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "A complete Vim editor simulation engine for Node.js. Implements motions, operators, visual mode, text objects, macros, marks, undo/redo tree, spell checking, and more. \nCheck out my demo here: https://vim.colefoster.ca/demo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vim",
|
|
7
7
|
"editor",
|