• Stars
    star
    369
  • Rank 115,686 (Top 3 %)
  • Language
    Lua
  • License
    GNU General Publi...
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Region selection with hints on the AST nodes of a document powered by treesitter

Treehopper ๐Ÿ‡

Syntax trees + hop = Treehopper

A Plugin that provides region selection using hints on the abstract syntax tree of a document.

Demo

Requirements

  • Neovim 0.7.2+

Treehopper operates on syntax trees. It uses tree-sitter to retrieve the tree if a parser is available, otherwise it tries to use the built-in LSP client in Neovim (using the selectionRange functionality).

You can install tree-sitter parsers either via:

Installation

  • Install it like any other neovim plugin:
    • If using vim-plug: Plug mfussenegger/nvim-treehopper
    • If using packer.nvim: use mfussenegger/nvim-treehopper

Usage

Selecting a region

Define two mappings:

omap     <silent> m :<C-U>lua require('tsht').nodes()<CR>
xnoremap <silent> m :lua require('tsht').nodes()<CR>

You can configure which keys are used for hint labels, the first N characters will be taken from the hint_keys and then after that it will restart from a-zA-Z

require("tsht").config.hint_keys = { "h", "j", "f", "d", "n", "v", "s", "l", "a" }

Moving

Moving depends on hop.nvim

If you want to move to the start or end of a syntax node you can use require('tsht').move({ side = "start" }).

The parameter is optional and defaults to start. Use side = "end" if you want to move to the end of a node.

Credits

More Repositories

1

nvim-dap

Debug Adapter Protocol client implementation for Neovim
Lua
3,600
star
2

nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
Lua
679
star
3

nvim-jdtls

Extensions for the built-in LSP support in Neovim for eclipse.jdt.ls
Lua
657
star
4

nvim-dap-python

An extension for nvim-dap, providing default configurations for python and methods to debug individual test methods or classes.
Lua
297
star
5

dotfiles

Various config files from my home directory
Lua
73
star
6

nvim-lsp-compl

A fast and asynchronous auto-completion plugin for Neovim, focused on LSP.
Lua
67
star
7

nvim-fzy

Fuzzy picker & vim.ui.select implementation via fzy for neovim
Lua
50
star
8

cr8

CLI collection of utilities for working with CrateDB or PostgreSQL. Benchmark queries, insert data.
Python
34
star
9

knx

python knx / eib client library
Python
26
star
10

mkjson

A commandline tool to generate static or random JSON records
Haskell
26
star
11

tornado-template

Tornado template with Jinja2 and Sqlalchemy
Python
22
star
12

nvim-lua-debugger

a Debug Adapter that allows debugging lua plugins written for Neovim
Lua
18
star
13

nvim-ansible

Small neovim plugin to make working with Ansible playbooks or roles more convenient
Lua
14
star
14

nvim-qwahl

Pickers for vim.ui.select
Lua
13
star
15

Huluobo

Web based rss reader written in python using tornado
CSS
13
star
16

crate-mono

Unmaintained Mono/.NET client driver for crate. Use npgsql-cratedb instead.
C#
10
star
17

easymail

A module that makes sending (valid) emails from python a little bit easier.
Python
6
star
18

pypsh

UNMAINTAINED: remotely execute commands in parallel with ssh on hostnames that match a regex.
Python
5
star
19

BaanPrint

Very simple output management framework for Infor ERP LN written in python.
Python
5
star
20

dinspect

Commandline tool to turn JSON into a chart
Python
3
star
21

docker-tornado-crate-demo

Simple demo showing how to run a python web app inside a docker container with a linked crate container
Python
3
star
22

crate-autocomplete

Plugin for Crate that provides SQL auto-complete functionality.
Java
3
star
23

java-benchopedia

Java
3
star
24

spacman

simple wrapper around pacman/pacsearch/aria2c to improve file download speed
Python
1
star
25

paperstore

python script to scan documents and search them later using a fulltext index
Python
1
star
26

crate-udf

Plugin for Crate that provides a mechanism to load user defined functions
Java
1
star
27

riccodo

generates static html sites from markdown files using jinja
Python
1
star
28

crate-peewee

Crate driver for peewee
Python
1
star