Vim editing
Every Vim motion and operator works in the query input — or ignore it entirely and just type in INSERT mode like a regular text field.
You want to change select(.active) to select(.name) in your query.
Same edit — put cursor anywhere on active, then use a Vim text object.
Two modes
jiq’s query input has two modes, shown by the border color:
Switch between modes
| From | To | Press |
|---|---|---|
| INSERT | NORMAL | Esc |
| NORMAL | INSERT at cursor | i |
| NORMAL | INSERT after cursor | a |
| NORMAL | INSERT at line start | I |
| NORMAL | INSERT at line end | A |
Move through the query
Basic movement
| Key | Motion |
|---|---|
h / l |
One character left / right |
w |
Next word start |
b |
Previous word start |
e |
End of current word |
0 / ^ |
Line start |
$ |
Line end |
Jump to a character
| Key | Motion |
|---|---|
f{c} |
Forward to character |
F{c} |
Backward to character |
t{c} |
Forward, stop before character |
T{c} |
Backward, stop after character |
; |
Repeat last char search (same direction) |
, |
Repeat last char search (opposite direction) |
Delete or change part of the query
Operators combine with motions: d deletes, c deletes and enters INSERT mode.
Operator + motion
| Key | Action |
|---|---|
dw / db / de |
Delete word forward / back / to end |
d$ / d0 / d^ |
Delete to line end / start |
dd / D |
Delete entire line / to end of line |
df{c} / dF{c} |
Delete through character forward / backward |
dt{c} / dT{c} |
Delete until character forward / backward |
cw / cb / ce |
Change word forward / back / to end |
c$ / c0 / c^ / cc / C |
Change to end / start / entire line |
cf{c} / cF{c} |
Change through character forward / backward |
ct{c} / cT{c} |
Change until character forward / backward |
Single-character edits
| Key | Action |
|---|---|
x |
Delete character at cursor |
X |
Delete character before cursor |
Text objects
Text objects select a region based on structure. Prefix with d to delete or c to change.
| Object | Scope | What it selects |
|---|---|---|
iw / aw |
Word | Inner word / word + surrounding space |
i" / a" |
Double quotes | Inside quotes / including quotes |
i' / a' |
Single quotes | Inside quotes / including quotes |
i` / a` |
Backticks | Inside ticks / including ticks |
i( / a( |
Parentheses | Inside parens / including parens |
i[ / a[ |
Brackets | Inside brackets / including brackets |
i{ / a{ |
Braces | Inside braces / including braces |
i\| / a\| |
Pipe segment | Inside pipe / including one pipe |
Work with pipe segments
The i| and a| text objects are jq-specific — they treat | as a delimiter, just like quotes or brackets work in Vim.
Use da| to delete the pipe segment including one pipe delimiter — useful for removing an entire stage from a pipeline.
Undo and redo
| Key | Action |
|---|---|
u |
Undo last change |
| Ctrl+R | Redo |
Undo tracks every edit. Multiple undos walk back through the full change history.
INSERT mode shortcuts
While in INSERT mode, these shortcuts are available without switching to NORMAL:
| Key | Action |
|---|---|
| Esc | Switch to NORMAL mode |
| Up / Ctrl+R | Open history popup |
| Ctrl+P / Ctrl+N | Previous / next query in history |
| Ctrl+D / Ctrl+U | Scroll results half page down / up |
All keys (NORMAL mode)
| Key | Action |
|---|---|
i / a / I / A |
Enter INSERT mode (at/after cursor, line start/end) |
h / l |
Move left / right |
0 / ^ / $ |
Line start / first non-space / line end |
w / b / e |
Word forward / back / end |
f{c} / F{c} / t{c} / T{c} |
Find / till character |
; / , |
Repeat / reverse last char search |
x / X |
Delete char at / before cursor |
dd / D |
Delete line / to end |
dw / cw / ciw |
Delete / change word |
df{c} / dt{c} / cf{c} / ct{c} |
Delete / change to / till char |
di" / ci" / di( / ci( / etc. |
Delete / change inside quotes / brackets |
di\| / ci\| / da\| / ca\| |
Delete / change inside / around pipe segment |
u |
Undo |
| Ctrl+R | Redo |
| Ctrl+D / Ctrl+U | Scroll results half page down / up |