Skip to content

atusy/jab.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 

Repository files navigation

🤜 jab.nvim

Motion plugin with label-hinting supporting Japanese (migemo).

Hit jabs to where you want to go with following motions!

  • incremental-search motions
  • f/F/t/T-like motions

They are dot-repeatable, so you can hit as many jabs as you want.

Recommendation

To hit jabs on Japanese characters, you need following plugins.

Demo

Incremental search

2024-11-26 12-26-31 mkv

f-motions

2024-11-26 12-27-03 mkv

Configurations

-- incremental search
-- if vim-kensaku is available and initial query is uppercase,
-- then the search is case-sensitive.
-- Otherwise, the search is case-insensitive.
-- hints appear on the left of the matches if possible.
vim.keymap.set({ "n", "x", "o" }, ";", function()
	return require("jab").jab_win()
end, { expr = true })

-- f-motions
-- search is always case-sensitive
-- hints appear exactly on the matches.
vim.keymap.set({ "n", "x", "o" }, "f", function()
	return require("jab").f()
end, { expr = true })
vim.keymap.set({ "n", "x", "o" }, "F", function()
	return require("jab").F()
end, { expr = true })
vim.keymap.set({ "n", "x", "o" }, "t", function()
	return require("jab").t()
end, { expr = true })
vim.keymap.set({ "n", "x", "o" }, "T", function()
	return require("jab").T()
end, { expr = true })

This plugin is based on my use case, so it has limited configurabilities.

Exceptionally, you can provide custome-labels like below.

vim.keymap.set({ "n", "x", "o" }, "f", function()
	return require("jab").f({ labels = { "a", "b", "c" } })
end, { expr = true })

Default labels are as follows.

  • f/F/t/T: See require("jab").labels_f
  • jab_win: See require("jab").labels_win

Note that jab_win is the incremental search, so the above labels are not always used as hints. It automatically ignore the labels that can be a part of the search query. For example, if you hit a and a buffer has abc, then b never be a hint.

About

Hit jabs on you want to go!

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages