vim-sim 1.0.7 → 1.0.9
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 +24 -46
- package/package.json +3 -3
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/)
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
A complete, production-ready Vim editor simulation engine for Node.js. Implements the full Vim editing experience with 85%+ test coverage, including motions, operators, visual mode, text objects, macros, marks, undo/redo tree, spell checking, and more.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
<details>
|
|
12
|
+
<summary><h2>Features</h2></summary>
|
|
12
13
|
|
|
13
14
|
### Core Editing
|
|
14
15
|
- **All Basic Motions**: `h`, `j`, `k`, `l`, `w`, `b`, `e`, `W`, `B`, `E`, `0`, `$`, `^`, `gg`, `G`, `{`, `}`, `(`, `)`, `%`
|
|
@@ -38,13 +39,16 @@ A complete, production-ready Vim editor simulation engine for Node.js. Implement
|
|
|
38
39
|
- **Comment Toggling**: Smart comment handling
|
|
39
40
|
- **Digraphs**: 150+ special characters
|
|
40
41
|
|
|
42
|
+
</details>
|
|
43
|
+
|
|
41
44
|
## Installation
|
|
42
45
|
|
|
43
46
|
```bash
|
|
44
47
|
npm install vim-sim
|
|
45
48
|
```
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+
<details>
|
|
51
|
+
<summary><h3>Quick Start</h3></summary>
|
|
48
52
|
|
|
49
53
|
```typescript
|
|
50
54
|
import { Session } from 'vim-sim';
|
|
@@ -89,7 +93,10 @@ console.log(currentState.cursor.line); // 0
|
|
|
89
93
|
console.log(currentState.cursor.column); // 7
|
|
90
94
|
```
|
|
91
95
|
|
|
92
|
-
|
|
96
|
+
</details>
|
|
97
|
+
|
|
98
|
+
<details>
|
|
99
|
+
<summary><h3>API Documentation</h3></summary>
|
|
93
100
|
|
|
94
101
|
### Session
|
|
95
102
|
|
|
@@ -206,7 +213,10 @@ enum Mode {
|
|
|
206
213
|
}
|
|
207
214
|
```
|
|
208
215
|
|
|
209
|
-
|
|
216
|
+
</details>
|
|
217
|
+
|
|
218
|
+
<details>
|
|
219
|
+
<summary><h3>Usage Examples</h3></summary>
|
|
210
220
|
|
|
211
221
|
### Basic Text Editing
|
|
212
222
|
|
|
@@ -363,7 +373,10 @@ console.log(session.getState().buffer.content);
|
|
|
363
373
|
// "Copy this text\nPaste here\nCopy this text"
|
|
364
374
|
```
|
|
365
375
|
|
|
366
|
-
|
|
376
|
+
</details>
|
|
377
|
+
|
|
378
|
+
<details>
|
|
379
|
+
<summary><h3>Advanced Usage</h3></summary>
|
|
367
380
|
|
|
368
381
|
### Custom Configuration
|
|
369
382
|
|
|
@@ -421,7 +434,10 @@ const windowManager = state.windowManager;
|
|
|
421
434
|
const activeWindow = windowManager.getActiveWindow();
|
|
422
435
|
```
|
|
423
436
|
|
|
424
|
-
|
|
437
|
+
</details>
|
|
438
|
+
|
|
439
|
+
<details>
|
|
440
|
+
<summary><h3>TypeScript Support</h3></summary>
|
|
425
441
|
|
|
426
442
|
This package is written in TypeScript and provides full type definitions.
|
|
427
443
|
|
|
@@ -437,43 +453,5 @@ function processVimState(state: State): void {
|
|
|
437
453
|
}
|
|
438
454
|
```
|
|
439
455
|
|
|
440
|
-
|
|
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
|
|
456
|
+
</details>
|
|
478
457
|
|
|
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.9",
|
|
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",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"motions",
|
|
15
15
|
"operators"
|
|
16
16
|
],
|
|
17
|
-
"homepage": "https://
|
|
17
|
+
"homepage": "https://vim.colefoster.ca/demo",
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/colefoster/vim-sim/issues"
|
|
20
20
|
},
|