Mr-LLLLL/treesitter-outer

github github
motion
stars 6
issues 0
subscribers 1
forks 0
CREATED

2023-09-14

UPDATED

2 months ago


Treesitter-Outer

In Some language like C/CPP, Go, Rust..., I always use [{ and ]} to jump outer { and }. But in lua, python..., it's not work any more. So i write this plug to do this.

jump to outer node smartly base on nvim-treesitter And thank nvim-treesitter-textsubject to provide Tree-Sitter queries

Screencasts

Installation

With lazy.nvim:

    {
        'Mr-LLLLL/treesitter-outer',
        dependencies = "nvim-treesitter/nvim-treesitter",
        -- only load this plug in follow filetypes
        ft = {
            "c",
            "cpp",
            "elixir",
            "fennel",
            "foam",
            "go",
            "javascript",
            "julia",
            "lua",
            "nix",
            "php",
            "python",
            "r",
            "ruby",
            "rust",
            "scss",
            "tsx",
            "typescript",
        },
        -- default config
        opts = {
            filetypes = {
                "c",
                "cpp",
                "elixir",
                "fennel",
                "foam",
                "go",
                "javascript",
                "julia",
                "lua",
                "nix",
                "php",
                "python",
                "r",
                "ruby",
                "rust",
                "scss",
                "tsx",
                "typescript",
            },
            mode = { 'n', 'v' },
            prev_outer_key = "[{",
            next_outer_key = "]}",
        },
    }