https://github.com/harrisoncramer/jump-tag
Neovim plugin for jumping between HTML tags.
https://github.com/harrisoncramer/jump-tag
html lua neovim neovim-plugin react treesitter vue
Last synced: 6 months ago
JSON representation
Neovim plugin for jumping between HTML tags.
- Host: GitHub
- URL: https://github.com/harrisoncramer/jump-tag
- Owner: harrisoncramer
- Created: 2021-12-24T16:56:06.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-25T14:13:00.000Z (over 2 years ago)
- Last Synced: 2025-07-22T01:57:18.708Z (6 months ago)
- Topics: html, lua, neovim, neovim-plugin, react, treesitter, vue
- Language: Lua
- Homepage:
- Size: 1.82 MB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JumpTag 🏃
This repository is an extremely lightweight Neovim plugin that enables jumping to parent, sibling, and child tags. It's written in Lua and makes use of the Treesitter AST to quickly make the jumps.
It's designed to work for plain HTML, Vue and React.

## Requirements
- Neovim 0.5+
- Treesitter
## Installation
Install with your favorite package manager, like Plug (or Packer, which is what I use):
```
use 'harrisoncramer/jump-tag'
```
## Features
This package does not provide any default mappings. You can call the functions directly or via mappings of your own. When hovering over a tag or anything inside of a tag (like it's attributes) you can call the following functions:
```
-- Jumps to the nearest parent
:lua require("jump-tag").jumpParent()
-- Jumps to the next sibling inside the current parent
:lua require("jump-tag").jumpNextSibling()
-- Jumps to the previous sibling inside the current parent
:lua require("jump-tag").jumpPrevSibling()
-- Jumps to the child of the current node
:lua require("jump-tag").jumpChild()
```
Here are the mappings that I use, because I prefer the jumpings to be on the `%` key:
```
vim.api.nvim_set_keymap('n', '55', ':lua require("jump-tag").jumpParent()', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '5n', ':lua require("jump-tag").jumpNextSibling()', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '5p', ':lua require("jump-tag").jumpPrevSibling()', { noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '5c', ':lua require("jump-tag").jumpChild()', { noremap = true, silent = true})
```