Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on lemmy.ml
neovim·Neovimbymawkler

New plugin jsx-element.nvim: JSX/TSX text-objects and motions

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 example dit 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 ─────────────────────╯
New plugin jsx-element.nvim: JSX/TSX text-objects and motionshttps://github.com/mawkler/jsx-element.nvimOpen linkView original on lemmy.ml
7

No replies yet

No comments on the original post yet.
New plugin jsx-element.nvim: JSX/TSX text-objects and motions | Spyke