__
/ /_ ____ ____
/ __ \/ __ \/ __ \
/ / / / /_/ / /_/ /
/_/ /_/\____/ .___/
/_/
· Neovim motions on speed! ·
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.
This is a fork of the original hop.nvim repo
:HopWord
).:HopCamelCase
).:HopChar1
).:HopChar2
).:HopPattern
).:HopLine
, :HopLineStart
).:HopAnywhere
).:HopNodes
).:HopPaste
).:HopYankChar1
).:Hop*MW
).v
, d
, c
, y
to visually select/delete/change/yank up to your new cursor position.:Hop*BC
, :Hop*AC
), for the current line (:Hop*CurrentLine
),
change the dictionary keys to use for the labels, jump on sole occurrence, etc.{
'smoka7/hop.nvim',
version = "*",
opts = {
keys = 'etovxqpdygfblzhckisuran'
}
}
use {
'smoka7/hop.nvim',
tag = '*', -- optional but strongly recommended
config = function()
-- you can configure Hop the way you like here; see :h hop-config
require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
end
}
Hop supports latest stable release and nightly releases of Neovim. However, keep in mind that if you are on a nightly version, you must be on the last one. If you are not, then you are exposed to compatibility issues / breakage.
This plugin implements [SemVer] via git tags. Versions are prefixed with a v
. You are advised to use a major version
dependency to be sure your config will not break when Hop gets updated.
See the wiki.
Hop doesn’t set any keybindings; you will have to define them by yourself.
If you want to create a key binding from within Lua:
-- place this in one of your configuration file(s)
local hop = require('hop')
local directions = require('hop.hint').HintDirection
vim.keymap.set('', 'f', function()
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
end, {remap=true})
vim.keymap.set('', 'F', function()
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
end, {remap=true})
vim.keymap.set('', 't', function()
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })
end, {remap=true})
vim.keymap.set('', 'T', function()
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })
end, {remap=true})