@leohenon/pi-vim 0.0.1
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 +129 -0
- package/assets/demo.gif +0 -0
- package/index.ts +1710 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# pi-vim
|
|
2
|
+
|
|
3
|
+
Full vim mode for [pi](https://github.com/badlogic/pi-mono).
|
|
4
|
+
|
|
5
|
+
Normal, insert, visual, and replace modes with motions, text objects, yank/put, and undo/redo.
|
|
6
|
+
|
|
7
|
+
## Demo
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pi install npm:@leohenon/pi-vim
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Toggle with:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
/vim-mode
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Insert mode
|
|
26
|
+
|
|
27
|
+
- `Esc` / `Ctrl-[` → normal mode
|
|
28
|
+
- `Shift+Alt+A` → line end
|
|
29
|
+
- `Shift+Alt+I` → line start
|
|
30
|
+
- `Alt+o` → open line below
|
|
31
|
+
- `Alt+Shift+O` → open line above
|
|
32
|
+
|
|
33
|
+
## Normal mode
|
|
34
|
+
|
|
35
|
+
### Mode
|
|
36
|
+
|
|
37
|
+
- `i`, `a`, `I`, `A`
|
|
38
|
+
- `o`, `O`
|
|
39
|
+
- `v` → visual
|
|
40
|
+
- `V` → visual line
|
|
41
|
+
- `R` → replace
|
|
42
|
+
|
|
43
|
+
### Motions
|
|
44
|
+
|
|
45
|
+
- `h`, `j`, `k`, `l`
|
|
46
|
+
- `w`, `b`, `e`
|
|
47
|
+
- `W`, `B`, `E`
|
|
48
|
+
- `0`, `^`, `_`, `$`
|
|
49
|
+
- `gg`, `G`
|
|
50
|
+
- `f`, `F`, `t`, `T`
|
|
51
|
+
- `;`, `,`
|
|
52
|
+
- counts on motions
|
|
53
|
+
|
|
54
|
+
### Delete
|
|
55
|
+
|
|
56
|
+
- `dd`, `dw`, `de`, `db`, `dW`, `dE`, `dB`
|
|
57
|
+
- `d0`, `d^`, `d$`, `d_`, `dG`
|
|
58
|
+
- `d{count}j`, `d{count}k`
|
|
59
|
+
- `df`, `dF`, `dt`, `dT`
|
|
60
|
+
- `diw`, `daw`, `di"`, `da"`, `di'`, `da'`, ``di` ``, ``da` ``, `di(`, `da(`, `di[`, `da[`, `di{`, `da{`
|
|
61
|
+
|
|
62
|
+
### Change
|
|
63
|
+
|
|
64
|
+
- `cc`, `cw`, `ce`, `cb`, `cW`, `cE`, `cB`
|
|
65
|
+
- `c0`, `c^`, `c$`, `c_`
|
|
66
|
+
- `cf`, `cF`, `ct`, `cT`
|
|
67
|
+
- `ciw`, `caw`, `ci"`, `ca"`, `ci'`, `ca'`, ``ci` ``, ``ca` ``, `ci(`, `ca(`, `ci[`, `ca[`, `ci{`, `ca{`
|
|
68
|
+
|
|
69
|
+
### Yank
|
|
70
|
+
|
|
71
|
+
- `yy`, `Y`
|
|
72
|
+
- `yw`, `ye`, `yb`, `yW`, `yE`, `yB`
|
|
73
|
+
- `y0`, `y^`, `y$`, `y_`, `yG`
|
|
74
|
+
- `y{count}j`, `y{count}k`
|
|
75
|
+
- `yf`
|
|
76
|
+
- `yiw`, `yaw`, `yi"`, `ya"`, `yi'`, `ya'`, ``yi` ``, ``ya` ``, `yi(`, `ya(`, `yi[`, `ya[`, `yi{`, `ya{`
|
|
77
|
+
|
|
78
|
+
### Edit
|
|
79
|
+
|
|
80
|
+
- `x`, `s`, `S`
|
|
81
|
+
- `r{char}`
|
|
82
|
+
- `R` → replace mode
|
|
83
|
+
- `~` → toggle case
|
|
84
|
+
- `D`, `C`
|
|
85
|
+
- counts on `x`, `r`, `~`
|
|
86
|
+
|
|
87
|
+
### Put
|
|
88
|
+
|
|
89
|
+
- `p`, `P`
|
|
90
|
+
- counts on `p`, `P`
|
|
91
|
+
|
|
92
|
+
### Undo
|
|
93
|
+
|
|
94
|
+
- `u`, `Ctrl-_`
|
|
95
|
+
- `Ctrl-r`
|
|
96
|
+
- counts on undo/redo
|
|
97
|
+
|
|
98
|
+
## Visual mode
|
|
99
|
+
|
|
100
|
+
### Characterwise
|
|
101
|
+
|
|
102
|
+
- `v` enters visual mode
|
|
103
|
+
- `Esc` exits to normal mode
|
|
104
|
+
- `d` / `x` delete selection
|
|
105
|
+
- `y` yank selection
|
|
106
|
+
- `c` change selection
|
|
107
|
+
- `p`, `P` replace selection with unnamed register
|
|
108
|
+
|
|
109
|
+
### Linewise
|
|
110
|
+
|
|
111
|
+
- `V` enters visual line mode
|
|
112
|
+
- `j`, `k` extend by full lines
|
|
113
|
+
- `Esc` exits to normal mode
|
|
114
|
+
- `d` / `x` delete selected lines
|
|
115
|
+
- `y` yank selected lines
|
|
116
|
+
- `c` change selected lines
|
|
117
|
+
- `p`, `P` replace selected lines
|
|
118
|
+
|
|
119
|
+
> [!NOTE]
|
|
120
|
+
> yanks and puts use an internal unnamed register, not the system clipboard
|
|
121
|
+
|
|
122
|
+
## Files
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
pi-vim/
|
|
126
|
+
index.ts
|
|
127
|
+
package.json
|
|
128
|
+
README.md
|
|
129
|
+
```
|
package/assets/demo.gif
ADDED
|
Binary file
|