Skip to content

A treesitter-module which will place equals, semicolons, commas and double points automatically for you!

Notifications You must be signed in to change notification settings

pm4rcin/tree-setter

 
 

Repository files navigation

Contributing

TREESETTER IS SEEKING CONTRIBUTORS TO HELP ADVANCE THE PROJECT'S GROWTH.

Take a look into the CONTRIBUTING.md file for that ;) Credit to TornaxO7.

TreeSetter

Never type an equals = or a semicolon ; again!

TreeSetter is an nvim-treesitter-module which automatically adds an equals sign (=) and semicolons (;) at the appropriate place whenever you hit enter (for ;) or the space bar (for =). This will help you to not look at your keyboard and type faster. The insertion of commas (,) and double points (:) is under development.

This plugin is a fork of TornaxO7/tree-setter, but the original repo is incomplete and has been archived.

Note: The plugin should work well most of the time, however since it's still very young, it is very possible that it has some bugs.

Languages: It supports many languages. Go inside the queries folder to see if your language is supported.

How it works

Simply press on the space bar to insert an equals sign (=) at the appropriate place e.g. after a variable declaration int x = 1; or x = 1. For Java and C, press enter at the end of the line to insert a semicolon (;).

TypeScript demo:

demonstration

Java:

demonstration

Installation

Vim-plug:

Plug 'filNaj/tree-setter'

Packer:

use 'filNaj/tree-setter'

Add tree_setter (and not tree_sitter !) into your treesitter settings:

require('nvim-treesitter.configs').setup {
    -- your other modules ...

    tree_setter = {
        enable = true
    },

    -- your other modules ...
}

TODO

  • Add colon : automatically, e.g. for switch cases.
  • Add commas , automatically, e.g. for lists or dictionaries.

About

A treesitter-module which will place equals, semicolons, commas and double points automatically for you!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 60.7%
  • Scheme 39.1%
  • Vim Script 0.2%