Skip to content

Commit

Permalink
feat(motion): Add hop.nvim (#210)
Browse files Browse the repository at this point in the history
* feat(motion): Add hop.nvim

* fix(motion): fixed hop.nvim location

---------

Co-authored-by: Micah Halter <micah@mehalter.com>
  • Loading branch information
jay-babu and mehalter committed May 24, 2023
1 parent ae48403 commit 22fe02f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ return {
event = { "User AstroFile" },
opts = function(_, opts)
if utils.is_available "leap.nvim" then opts.exclude = utils.list_insert_unique(opts.exclude, { "ns", "nS" }) end
if utils.is_available "hop.nvim" then opts.exclude = utils.list_insert_unique(opts.exclude, { "ns", "nS" }) end
end,
}
5 changes: 5 additions & 0 deletions lua/astrocommunity/motion/hop-nvim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# hop.nvim

**Repository:** <https://github.com/phaazon/hop.nvim>

Hop is an EasyMotion-like plugin allowing you to jump anywhere in a document with as few keystrokes as possible. It does so by annotating text in your buffer with hints, short string sequences for which each character represents a key to type to jump to the annotated text. Most of the time, those sequences’ lengths will be between 1 to 3 characters, making every jump target in your document reachable in a few keystrokes.
30 changes: 30 additions & 0 deletions lua/astrocommunity/motion/hop-nvim/hop.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
return {
"phaazon/hop.nvim",
opts = {},
keys = {
{
"s",
function() require("hop").hint_words() end,
mode = { "n" },
desc = "Hop hint words",
},
{
"<S-s>",
function() require("hop").hint_lines() end,
mode = { "n" },
desc = "Hop hint lines",
},
{
"s",
function() require("hop").hint_words { extend_visual = true } end,
mode = { "n" },
desc = "Hop hint words",
},
{
"<S-s>",
function() require("hop").hint_lines { extend_visual = true } end,
mode = { "v" },
desc = "Hop hint lines",
},
},
}

0 comments on commit 22fe02f

Please sign in to comment.