neovim icon indicating copy to clipboard operation
neovim copied to clipboard

structural-editing: paredit style commands

Open practicalli-johnny opened this issue 9 months ago • 0 comments

NOTE: unless nvim-treesitter-sexp issues with Neovim 0.11 are resolved, then this should focus on using nvim-paredit (or nvim-par-par) plugin. The commands should be fairly similar.

Once you understand the pattern for the nvim-treesitter-sexp commands they they become much simpler to remember

< and > represent the direction of travel, from the small side to the large

( and ) represent the parens side to be effected

< moves code to the right

> moves code to the left

The commands

  • slurp_left <( move form before the open paren to inside the paren (slurp from the left)
  • slurp_right >) move form after the close paren to inside the paren (slurp from the right)
  • barf_left >(
  • barf_right <)

Prerequisites

related: https://github.com/practicalli/nvim-astro5/issues/20

practicalli-johnny avatar Mar 02 '25 23:03 practicalli-johnny