Skip to content

xiaoshihou514/squirrel.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐿️ squirrel.nvim

LuaRocks

A small squirrel jumping around the syntax tree!

Screencast.mp4

Features

  • Small and lightweight
  • Jump to the start/end of treesitter nodes
  • Linewise jump + jump to any visible spot

Installation

Install like any other plugin, I would recommend using rocks.nvim, add the following to your rocks.toml by using Rocks edit

"squirrel.nvim" = "1.0.0"

Keymaps

The following are already mapped on load, you can also remap it to whatever you want

-- jump to start of any node on the current line
vim.keymap.set({ "n", "x" }, "gaa", require("squirrel.hop").hop_linewise)
-- jump to start of any visible node
vim.keymap.set({ "n", "x" }, "ga", require("squirrel.hop").hop)
-- jump to end of any node on the current line
vim.keymap.set({ "n", "x" }, "gee", function()
    require("squirrel.hop").hop_linewise({
        head = false,
        tail = true,
    })
end)
-- jump to end of any visible node
vim.keymap.set({ "n", "x" }, "ge", function()
    require("squirrel.hop").hop({
        head = false,
        tail = true,
    })
end)

If you want, you can also jump to any start or end of nodes

require("squirrel.hop").hop_linewise({ head = true, tail = true })

Configuration

Nonexistent, probably won't be one

About

Jump around quickly using treesitter!

Topics

Resources

License

Stars

Watchers

Forks

Languages