an opinionated jump motion implementation
gallop-2023-05-16_21.20.03.mp4
- be minimal: no callback, no back-forth, no {treesitter,lsp}-backed
- only for the viewport of currently window
- every label is a printable ascii char
- when labels are not enough, the rest targets will be discarded silently
- no excluding comments and string literals
- no caching collected targets
- respect jumplist
- limited support repeat via
,
and;
- it does not work in neovide/nvim-qt due to tty:read()
- using it on a &foldenable window is an UB
- just works
- feature-complete
- linux
- nvim 0.10.*
- haolian9/infra.nvim
here's my personal setting
do --repeats
m.n(",", function() require("infra.repeats").rhs_comma() end)
m.n(";", function() require("infra.repeats").rhs_semicolon() end)
end
do --gallop
local last_chars
m({ "n", "x" }, "s", function() last_chars = require("gallop").words(2, last_chars, true) or last_chars end)
m({ "n", "x" }, [[\]], function() last_chars = require("gallop").strings(2, last_chars, true) or last_chars end)
m({ "n", "x" }, "gl", function() require("gallop").lines() end)
m({ "n", "x" }, "go", function() require("gallop").cursorcolumn() end)
m.o("s", "<cmd>lua require'gallop'.strings(2)<cr>")
end