Hi! I built this small plugin that adds JSX/TSX text-objects and motions using Treesitter: jsx-element.nvim. I was surprised that it (to my knowledge) doesn’t exist yet.
From the README:
Use
]t
/[t
to go to the next/previous JSX/TSX element.Use
it
/at
to use JSX/TSX elements as text-objects. For exampledit
for “delete inside tag”. This works with self-closing elements:
<Checkbox value="checkedA" /> ╰───── it ─────╯ ╰─────────── at ────────────╯
It also works with paired elements:
<Button variant="text">This is a button</Button> ╰───── it ─────╯ ╰───────────────────── at ─────────────────────╯
You must log in or # to comment.