jvim 0.7.1__tar.gz → 0.7.3__tar.gz
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.
- jvim-0.7.3/.claude/settings.local.json +16 -0
- jvim-0.7.3/.gitignore +13 -0
- jvim-0.7.3/.swp +0 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/.git +1 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/README.kr.md +165 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/README.md +167 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-fold}/pyproject.toml +1 -1
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-fold}/src/jvim/__init__.py +1 -1
- jvim-0.7.3/.worktrees/codex-fix-fold/src/jvim/data/help.json +64 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/src/jvim/diff.py +346 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/src/jvim/differ.py +538 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/src/jvim/differ.tcss +56 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/src/jvim/editor.py +411 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/src/jvim/widget.py +2843 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/tests/test_diff.py +633 -0
- jvim-0.7.3/.worktrees/codex-fix-fold/tests/test_editor.py +1418 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/.git +1 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/.gitignore +12 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/CLAUDE.md +44 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/README.kr.md +231 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/README.md +233 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/pyproject.toml +57 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/__init__.py +6 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/__main__.py +5 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/data/help.json +70 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/data/sample.json +25 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/differ.py +558 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/differ.tcss +56 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/editor.py +411 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/editor.tcss +73 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/py.typed +0 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/src/jvim/widget.py +3275 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/tests/__init__.py +0 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/tests/test_diff.py +728 -0
- jvim-0.7.3/.worktrees/codex-fix-subst/tests/test_editor.py +1821 -0
- jvim-0.7.3/CLAUDE.md +44 -0
- {jvim-0.7.1 → jvim-0.7.3}/PKG-INFO +12 -1
- {jvim-0.7.1 → jvim-0.7.3}/README.kr.md +11 -0
- {jvim-0.7.1 → jvim-0.7.3}/README.md +11 -0
- jvim-0.7.3/docs/jvim.svg +199 -0
- jvim-0.7.3/docs/jvimdiff.svg +213 -0
- jvim-0.7.3/docs/vim-compatibility-report.md +192 -0
- jvim-0.7.3/pyproject.toml +57 -0
- jvim-0.7.3/scripts/benchmark.py +253 -0
- jvim-0.7.3/scripts/screenshots.py +147 -0
- jvim-0.7.3/src/jvim/__init__.py +6 -0
- jvim-0.7.3/src/jvim/__main__.py +5 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/jsonpath_locator.py +3 -1
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/navigation.py +14 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/data/help.json +1 -0
- jvim-0.7.3/src/jvim/data/sample.json +25 -0
- jvim-0.7.3/src/jvim/diff.py +372 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/differ.py +2 -2
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/editor.py +1 -1
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/mode/normal.py +17 -0
- jvim-0.7.3/src/jvim/py.typed +0 -0
- jvim-0.7.3/src/jvim/styles/editor.tcss +73 -0
- jvim-0.7.3/tests/__init__.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/tests/test_editor.py +82 -0
- jvim-0.7.1/.claude/settings.local.json +0 -16
- jvim-0.7.1/CLAUDE.local.md +0 -3
- jvim-0.7.1/COMMENTS.md +0 -96
- jvim-0.7.1/demo/demo.tape +0 -94
- jvim-0.7.1/demo/jvim-demo.gif +0 -0
- jvim-0.7.1/demo/sample.json +0 -55
- jvim-0.7.1/docs/demo-feature.json +0 -12
- jvim-0.7.1/docs/jvim-editor-core.gif +0 -0
- jvim-0.7.1/docs/jvim-editor-core.tape +0 -43
- jvim-0.7.1/docs/jvim-embedded-json.gif +0 -0
- jvim-0.7.1/docs/jvim-embedded-json.tape +0 -42
- jvim-0.7.1/docs/jvim-jsonpath.gif +0 -0
- jvim-0.7.1/docs/jvim-jsonpath.tape +0 -56
- jvim-0.7.1/docs/jvimdiff-demo.gif +0 -0
- jvim-0.7.1/docs/jvimdiff-demo.tape +0 -44
- jvim-0.7.1/docs/jvimdiff-sync.gif +0 -0
- jvim-0.7.1/docs/jvimdiff-sync.tape +0 -29
- jvim-0.7.1/tasks/lessons.md +0 -20
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-fold}/.gitignore +0 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-fold}/CLAUDE.md +0 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-fold}/src/jvim/__main__.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-fold}/src/jvim/data/sample.json +0 -0
- {jvim-0.7.1/src/jvim/styles → jvim-0.7.3/.worktrees/codex-fix-fold/src/jvim}/editor.tcss +0 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-fold}/src/jvim/py.typed +0 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-fold}/tests/__init__.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-subst}/docs/jvim.svg +0 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-subst}/docs/jvimdiff.svg +0 -0
- {jvim-0.7.1 → jvim-0.7.3/.worktrees/codex-fix-subst}/src/jvim/diff.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/__init__.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/clipboard.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/content.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/folding.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/jsonpath.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/render.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/substitute.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/undo.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/action/visual.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/mode/__init__.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/mode/command.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/mode/insert.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/mode/search.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/styles/differ.tcss +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/src/jvim/widget.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/tests/test_diff.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/tests/test_jsonpath_locator.py +0 -0
- {jvim-0.7.1 → jvim-0.7.3}/uv.lock +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"WebFetch(domain:news.ycombinator.com)",
|
|
5
|
+
"WebFetch(domain:github.com)",
|
|
6
|
+
"Bash(python scripts/benchmark.py:*)",
|
|
7
|
+
"Bash(git:*)",
|
|
8
|
+
"Bash(gh repo:*)",
|
|
9
|
+
"Bash(gh api:*)",
|
|
10
|
+
"Bash(python -m build)",
|
|
11
|
+
"Bash(twine upload:*)",
|
|
12
|
+
"Bash(gh release:*)",
|
|
13
|
+
"Bash(python:*)"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
jvim-0.7.3/.gitignore
ADDED
jvim-0.7.3/.swp
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gitdir: /Users/edgar/Workspace/jvim/.git/worktrees/codex-fix-fold
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# jvim
|
|
2
|
+
|
|
3
|
+
[Textual](https://github.com/Textualize/textual) 기반의 vim 스타일 JSON 편집기입니다.
|
|
4
|
+
|
|
5
|
+
## 주요 기능
|
|
6
|
+
|
|
7
|
+
- **Vim 스타일 모달 편집** - Normal, Insert, Command, Search 모드 지원
|
|
8
|
+
- **구문 강조** - JSON 문법에 맞는 색상 표시
|
|
9
|
+
- **JSON 검증** - 실시간 유효성 검사 및 오류 표시
|
|
10
|
+
- **JSONPath 검색** - JSONPath 표현식으로 검색 (`$.foo.bar`)
|
|
11
|
+
- **JSONL 지원** - JSON Lines 파일을 스마트하게 포맷팅하여 편집
|
|
12
|
+
- **내장 JSON 편집** - JSON 내 문자열로 저장된 JSON을 중첩 레벨까지 편집
|
|
13
|
+
- **Visual 모드** - 문자 단위(`v`) 및 줄 단위(`V`) 선택 후 `d`/`y`/`c` 연산자 지원
|
|
14
|
+
- **접기(Folding)** - JSON 블록과 긴 문자열 값을 접기/펼치기
|
|
15
|
+
- **괄호 매칭** - `%`로 짝이 맞는 괄호로 이동
|
|
16
|
+
- **Undo/Redo** - 전체 실행 취소 기록 지원
|
|
17
|
+
|
|
18
|
+
## 설치
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install jvim
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 사용법
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# 파일 열기
|
|
28
|
+
jvim data.json
|
|
29
|
+
|
|
30
|
+
# 읽기 전용 모드로 열기
|
|
31
|
+
jvim -R data.json
|
|
32
|
+
|
|
33
|
+
# 새 파일 생성
|
|
34
|
+
jvim newfile.json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`jvi`, `jv` 단축 명령도 사용 가능합니다.
|
|
38
|
+
|
|
39
|
+
## JSONL 지원
|
|
40
|
+
|
|
41
|
+
jvim은 JSON Lines (`.jsonl`) 파일을 특별하게 처리합니다:
|
|
42
|
+
|
|
43
|
+
- **포맷팅된 편집**: 각 JSONL 레코드를 자동으로 들여쓰기하여 읽고 편집하기 쉽게 표시
|
|
44
|
+
- **압축 저장**: 저장 시 각 레코드를 한 줄로 압축하여 JSONL 형식 유지
|
|
45
|
+
- **레코드 번호**: 두 번째 열에 레코드 번호(1, 2, 3...)를 표시하여 쉽게 탐색
|
|
46
|
+
- **플로팅 헤더**: 여러 줄에 걸친 레코드를 스크롤할 때 물리적 라인 번호가 상단에 표시
|
|
47
|
+
|
|
48
|
+
예시: 두 개의 레코드가 있는 JSONL 파일:
|
|
49
|
+
```
|
|
50
|
+
{"name": "Alice", "age": 30}
|
|
51
|
+
{"name": "Bob", "age": 25}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
jvim에서 열면:
|
|
55
|
+
```
|
|
56
|
+
{
|
|
57
|
+
"name": "Alice",
|
|
58
|
+
"age": 30
|
|
59
|
+
}
|
|
60
|
+
{
|
|
61
|
+
"name": "Bob",
|
|
62
|
+
"age": 25
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
저장하면 원래의 압축된 형식으로 복원됩니다.
|
|
67
|
+
|
|
68
|
+
## JSONPath 검색
|
|
69
|
+
|
|
70
|
+
jvim은 값 필터링이 가능한 강력한 JSONPath 검색을 지원합니다.
|
|
71
|
+
|
|
72
|
+
### 기본 JSONPath
|
|
73
|
+
|
|
74
|
+
`$.` 또는 `$[`로 시작하는 검색 패턴은 자동으로 JSONPath로 인식됩니다:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
/$.name # "name" 필드 찾기
|
|
78
|
+
/$..email # 모든 "email" 필드 찾기 (재귀)
|
|
79
|
+
/$.users[0] # 첫 번째 사용자
|
|
80
|
+
/$.users[*].name # 모든 사용자 이름
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 값 필터링
|
|
84
|
+
|
|
85
|
+
비교 연산자를 사용하여 값으로 검색 결과를 필터링할 수 있습니다:
|
|
86
|
+
|
|
87
|
+
| 연산자 | 설명 | 예시 |
|
|
88
|
+
|--------|------|------|
|
|
89
|
+
| `=` | 같음 | `$.status="active"` |
|
|
90
|
+
| `!=` | 다름 | `$.status!=null` |
|
|
91
|
+
| `>` | 초과 | `$.age>18` |
|
|
92
|
+
| `<` | 미만 | `$.price<100` |
|
|
93
|
+
| `>=` | 이상 | `$.count>=5` |
|
|
94
|
+
| `<=` | 이하 | `$.count<=10` |
|
|
95
|
+
| `~` | 정규식 매칭 | `$.email~@gmail\.com$` |
|
|
96
|
+
|
|
97
|
+
### 예시
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
/$.users[*].age>30 # 30세 초과 사용자
|
|
101
|
+
/$.items[*].status="active" # 활성 상태인 아이템
|
|
102
|
+
/$..name~^J # J로 시작하는 모든 이름
|
|
103
|
+
/$.price<=1000 # 1000 이하 가격
|
|
104
|
+
/$.config.enabled=true # 활성화된 설정
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 검색 수정자
|
|
108
|
+
|
|
109
|
+
| 접미사 | 설명 |
|
|
110
|
+
|--------|------|
|
|
111
|
+
| `\j` | 모호한 패턴을 JSONPath 모드로 강제 |
|
|
112
|
+
| `\c` | 대소문자 무시 (정규식 텍스트 검색용) |
|
|
113
|
+
| `\C` | 대소문자 구분 (정규식 텍스트 검색용) |
|
|
114
|
+
|
|
115
|
+
### 히스토리
|
|
116
|
+
|
|
117
|
+
검색 및 명령어 히스토리가 `~/.jvim/history.json`에 자동 저장되며 다음 실행 시 복원됩니다. 검색(`/`) 및 명령(`:`) 모드에서 화살표 키(`↑`/`↓`)로 히스토리를 탐색할 수 있습니다.
|
|
118
|
+
|
|
119
|
+
## 내장 JSON 편집 (ej 모드)
|
|
120
|
+
|
|
121
|
+
JSON 파일에는 종종 이스케이프된 JSON 문자열이 값으로 포함됩니다. jvim은 이러한 중첩된 JSON 구조를 자연스럽게 편집할 수 있게 해줍니다.
|
|
122
|
+
|
|
123
|
+
### 사용 방법
|
|
124
|
+
|
|
125
|
+
1. JSON 문자열 값이 있는 라인에 커서를 위치
|
|
126
|
+
2. Normal 모드에서 `ej` 입력
|
|
127
|
+
3. 새 편집기 패널이 열리며 파싱되고 포맷팅된 JSON 표시
|
|
128
|
+
4. 구문 강조와 유효성 검사가 적용된 상태로 내장 JSON 편집
|
|
129
|
+
5. `:w`로 저장하여 부모 문서에 반영(압축됨) 또는 `:q`로 취소
|
|
130
|
+
|
|
131
|
+
### 중첩 레벨
|
|
132
|
+
|
|
133
|
+
내장 JSON 안의 내장 JSON도 편집할 수 있습니다:
|
|
134
|
+
- 패널 제목에 현재 중첩 레벨 표시: `Edit Embedded JSON (level 1)`
|
|
135
|
+
- 저장하지 않은 변경 사항이 있으면 `[+]` 표시
|
|
136
|
+
- `:w`로 부모 문서에 저장하고 편집 계속
|
|
137
|
+
- `:wq`로 저장하고 이전 레벨로 복귀
|
|
138
|
+
- `:q!`로 변경 사항을 버리고 이전 레벨로 복귀
|
|
139
|
+
|
|
140
|
+
### 예시
|
|
141
|
+
|
|
142
|
+
다음과 같은 JSON이 있을 때:
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"config": "{\"host\": \"localhost\", \"port\": 8080}"
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
config 라인에서 `ej`를 사용하면:
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"host": "localhost",
|
|
153
|
+
"port": 8080
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
편집 후 저장하면, 부모 문서에 압축된 결과가 반영됩니다.
|
|
158
|
+
|
|
159
|
+
## 키 바인딩
|
|
160
|
+
|
|
161
|
+
jvim 내에서 `:help`를 입력하면 전체 키 바인딩을 확인할 수 있습니다.
|
|
162
|
+
|
|
163
|
+
## 라이선스
|
|
164
|
+
|
|
165
|
+
MIT
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# jvim
|
|
2
|
+
|
|
3
|
+
JSON editor with vim-style keybindings, built with [Textual](https://github.com/Textualize/textual).
|
|
4
|
+
|
|
5
|
+
[한국어](README.kr.md)
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Vim-style modal editing** - Normal, Insert, Command, and Search modes
|
|
10
|
+
- **Syntax highlighting** - JSON-aware colorization
|
|
11
|
+
- **JSON validation** - Real-time validation with error reporting
|
|
12
|
+
- **JSONPath search** - Search using JSONPath expressions (`$.foo.bar`)
|
|
13
|
+
- **JSONL support** - Edit JSON Lines files with smart formatting
|
|
14
|
+
- **Embedded JSON editing** - Edit JSON strings within JSON with nested level support
|
|
15
|
+
- **Visual mode** - Character-wise (`v`) and line-wise (`V`) selection with `d`/`y`/`c` operators
|
|
16
|
+
- **Folding** - Collapse/expand JSON blocks and long string values
|
|
17
|
+
- **Bracket matching** - Jump to matching brackets with `%`
|
|
18
|
+
- **Undo/Redo** - Full undo history
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install jvim
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Open a file
|
|
30
|
+
jvim data.json
|
|
31
|
+
|
|
32
|
+
# Open in read-only mode
|
|
33
|
+
jvim -R data.json
|
|
34
|
+
|
|
35
|
+
# Create new file
|
|
36
|
+
jvim newfile.json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Also available as `jvi` and `jv` shortcuts.
|
|
40
|
+
|
|
41
|
+
## JSONL Support
|
|
42
|
+
|
|
43
|
+
jvim provides special handling for JSON Lines (`.jsonl`) files:
|
|
44
|
+
|
|
45
|
+
- **Pretty-printed editing**: Each JSONL record is automatically formatted with indentation for easy reading and editing
|
|
46
|
+
- **Compact saving**: When you save, each record is minified back to a single line, preserving the JSONL format
|
|
47
|
+
- **Record numbers**: A second column shows the record number (1, 2, 3...) for easy navigation
|
|
48
|
+
- **Floating header**: When scrolling through a multi-line record, the physical line number stays visible at the top
|
|
49
|
+
|
|
50
|
+
Example: A JSONL file with two records:
|
|
51
|
+
```
|
|
52
|
+
{"name": "Alice", "age": 30}
|
|
53
|
+
{"name": "Bob", "age": 25}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Opens in jvim as:
|
|
57
|
+
```
|
|
58
|
+
{
|
|
59
|
+
"name": "Alice",
|
|
60
|
+
"age": 30
|
|
61
|
+
}
|
|
62
|
+
{
|
|
63
|
+
"name": "Bob",
|
|
64
|
+
"age": 25
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
And saves back to the original compact format.
|
|
69
|
+
|
|
70
|
+
## JSONPath Search
|
|
71
|
+
|
|
72
|
+
jvim supports powerful JSONPath searching with value filtering.
|
|
73
|
+
|
|
74
|
+
### Basic JSONPath
|
|
75
|
+
|
|
76
|
+
Search patterns starting with `$.` or `$[` are automatically recognized as JSONPath:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
/$.name # Find the "name" field
|
|
80
|
+
/$..email # Find all "email" fields (recursive)
|
|
81
|
+
/$.users[0] # First user
|
|
82
|
+
/$.users[*].name # All user names
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Value Filtering
|
|
86
|
+
|
|
87
|
+
You can filter search results by value using comparison operators:
|
|
88
|
+
|
|
89
|
+
| Operator | Description | Example |
|
|
90
|
+
|----------|-------------|---------|
|
|
91
|
+
| `=` | Equals | `$.status="active"` |
|
|
92
|
+
| `!=` | Not equals | `$.status!=null` |
|
|
93
|
+
| `>` | Greater than | `$.age>18` |
|
|
94
|
+
| `<` | Less than | `$.price<100` |
|
|
95
|
+
| `>=` | Greater or equal | `$.count>=5` |
|
|
96
|
+
| `<=` | Less or equal | `$.count<=10` |
|
|
97
|
+
| `~` | Regex match | `$.email~@gmail\.com$` |
|
|
98
|
+
|
|
99
|
+
### Examples
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
/$.users[*].age>30 # Users older than 30
|
|
103
|
+
/$.items[*].status="active" # Items with active status
|
|
104
|
+
/$..name~^J # All names starting with J
|
|
105
|
+
/$.price<=1000 # Price 1000 or less
|
|
106
|
+
/$.config.enabled=true # Enabled configs
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Search Modifiers
|
|
110
|
+
|
|
111
|
+
| Suffix | Description |
|
|
112
|
+
|--------|-------------|
|
|
113
|
+
| `\j` | Force JSONPath mode for ambiguous patterns |
|
|
114
|
+
| `\c` | Case insensitive (for regex text search) |
|
|
115
|
+
| `\C` | Case sensitive (for regex text search) |
|
|
116
|
+
|
|
117
|
+
### History
|
|
118
|
+
|
|
119
|
+
Search and command history is automatically saved to `~/.jvim/history.json` and restored on next launch. Use arrow keys (`↑`/`↓`) to navigate history in search (`/`) and command (`:`) modes.
|
|
120
|
+
|
|
121
|
+
## Embedded JSON Editing
|
|
122
|
+
|
|
123
|
+
JSON files often contain escaped JSON strings as values. jvim lets you edit these nested JSON structures naturally.
|
|
124
|
+
|
|
125
|
+
### How it works
|
|
126
|
+
|
|
127
|
+
1. Position your cursor on a line containing a JSON string value
|
|
128
|
+
2. Type `ej` in normal mode
|
|
129
|
+
3. A new editor panel opens with the parsed and formatted JSON
|
|
130
|
+
4. Edit the embedded JSON with full syntax highlighting and validation
|
|
131
|
+
5. Save with `:w` to update the parent document (minified) or `:q` to cancel
|
|
132
|
+
|
|
133
|
+
### Nested levels
|
|
134
|
+
|
|
135
|
+
You can edit embedded JSON within embedded JSON:
|
|
136
|
+
- The panel title shows the current nesting level: `Edit Embedded JSON (level 1)`
|
|
137
|
+
- A `[+]` indicator appears when you have unsaved changes
|
|
138
|
+
- `:w` saves to the parent document and continues editing
|
|
139
|
+
- `:wq` saves and returns to the previous level
|
|
140
|
+
- `:q!` discards changes and returns to the previous level
|
|
141
|
+
|
|
142
|
+
### Example
|
|
143
|
+
|
|
144
|
+
Given this JSON:
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"config": "{\"host\": \"localhost\", \"port\": 8080}"
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Using `ej` on the config line opens:
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"host": "localhost",
|
|
155
|
+
"port": 8080
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
After editing and saving, the parent is updated with the minified result.
|
|
160
|
+
|
|
161
|
+
## Keybindings
|
|
162
|
+
|
|
163
|
+
Use `:help` inside jvim to see the full keybinding reference.
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
MIT
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Movement": {
|
|
3
|
+
"h j k l": "left/down/up/right",
|
|
4
|
+
"w b": "word forward/backward",
|
|
5
|
+
"0 $ ^": "line start/end/first char",
|
|
6
|
+
"gg G": "file start/end",
|
|
7
|
+
"%": "jump to matching bracket",
|
|
8
|
+
"PgUp PgDn": "page up/down",
|
|
9
|
+
"Ctrl+d/u": "half page down/up"
|
|
10
|
+
},
|
|
11
|
+
"Search": {
|
|
12
|
+
"/": "search forward",
|
|
13
|
+
"?": "search backward",
|
|
14
|
+
"n": "next match",
|
|
15
|
+
"N": "previous match",
|
|
16
|
+
"Up/Down": "search history",
|
|
17
|
+
"\\c \\C": "case insensitive/sensitive",
|
|
18
|
+
"/$. /$[": "JSONPath search (auto-detect)",
|
|
19
|
+
"\\j": "JSONPath suffix for other patterns"
|
|
20
|
+
},
|
|
21
|
+
"Insert Mode": {
|
|
22
|
+
"i I": "insert at cursor/line start",
|
|
23
|
+
"a A": "append after cursor/line end",
|
|
24
|
+
"o O": "open line below/above"
|
|
25
|
+
},
|
|
26
|
+
"Editing": {
|
|
27
|
+
"x": "delete char",
|
|
28
|
+
"dd": "delete line",
|
|
29
|
+
"dw d$": "delete word/to end",
|
|
30
|
+
"cw cc": "change word/line",
|
|
31
|
+
"r{c}": "replace char",
|
|
32
|
+
"J": "join lines",
|
|
33
|
+
"yy p P": "yank/paste after/before",
|
|
34
|
+
"u": "undo",
|
|
35
|
+
"Ctrl+r": "redo",
|
|
36
|
+
".": "repeat last edit",
|
|
37
|
+
"ej": "edit embedded JSON string"
|
|
38
|
+
},
|
|
39
|
+
"Visual Mode": {
|
|
40
|
+
"v": "character-wise selection",
|
|
41
|
+
"V": "line-wise selection",
|
|
42
|
+
"d": "delete selection",
|
|
43
|
+
"y": "yank selection",
|
|
44
|
+
"c": "change selection",
|
|
45
|
+
"Esc": "exit visual mode"
|
|
46
|
+
},
|
|
47
|
+
"Folding": {
|
|
48
|
+
"za": "toggle fold",
|
|
49
|
+
"zo": "open fold",
|
|
50
|
+
"zc": "close fold",
|
|
51
|
+
"zM": "fold all",
|
|
52
|
+
"zR": "unfold all"
|
|
53
|
+
},
|
|
54
|
+
"Commands": {
|
|
55
|
+
":w": "save",
|
|
56
|
+
":w {file}": "save as",
|
|
57
|
+
":e {file}": "open file",
|
|
58
|
+
":fmt": "format JSON",
|
|
59
|
+
":q": "quit (confirm if changed)",
|
|
60
|
+
":q!": "quit (discard changes)",
|
|
61
|
+
":wq": "save and quit",
|
|
62
|
+
":help": "toggle this help"
|
|
63
|
+
}
|
|
64
|
+
}
|