Swapping objects with `nvim-treesitter-textobjects`

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • nvim-treesitter-textobjects

  • Few weeks ago I installed the nvim-treesitter-textobjects plugin and after reading about overriding or extending textobjects, I decided to try to make the swap thing a little better.

  • playground

    Discontinued Treesitter playground integrated into Neovim (by nvim-treesitter)

  • First thing I did was create the queries folder in the configuration folder for Neovim. Then I created the lua folder containing the textobjects.scm file. In order to know better the node types to match against, I also installed the playground plugin.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • dotsoup

    Atchim's dotfiles

  • Of course! You can find it right here.

  • iswap.nvim

    Interactively select and swap function arguments, list elements, and much more. Powered by tree-sitter.

  • Btw, I found the queries from https://github.com/mizlan/iswap.nvim helpful in implementing this approach. (For example I found (variable_list (_) @swappable) was not covered in your lua queries. Once again thanks, this is great fun!

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts