smoka7 / hop.nvim Goto Github PK
View Code? Open in Web Editor NEWThis project forked from hadronized/hop.nvim
Neovim motions on speed!
License: Other
This project forked from hadronized/hop.nvim
Neovim motions on speed!
License: Other
In many applications that allow for hints (alacritty, vimium in the browser), pressing backspace after the initial key press allows you to go back to the previous hint state. Would it be possible to implement the same in hop? e.g. if I HopWord
and the hints lr
kr
show up somewhere in the buffer. I press l
, and the hint updates to r
. I want to press <BS>
to go back to lr
in case I made a mistake initially pressing l
and instead intended to press k
. As things are right now I have to HopWord
again.
Hi
It seems the documentation is still referencing old locations of some functions.
E.g. regex_by_word_start() is no longer in jump_targets but in jump_regex.
Describe the bug
hint_char1 uses regexp search instead of a straightforward character search.
To Reproduce
This should be straightforward to reproduce:
Define an f
keymap as recommended by documentation:
vim.keymap.set('', 'f', function()
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
end, {remap=true})
Some text [text in brackets]
f[
You'll see
E5108: Error executing lua: .../.local/share/nvim/lazy/hop.nvim/lua/hop/jump_target.lua:413: couldn't parse regex: Vim:E769: Missing ] after %s[
stack traceback:
[C]: in function 'regex'
.../.local/share/nvim/lazy/hop.nvim/lua/hop/jump_target.lua:413: in function 'regex_by_case_searching'
...rzmilka/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:519: in function 'hint_char1'
/Users/grzegorzmilka/.config/nvim/lua/misc-plugins.lua:348: in function </Users/grzegorzmilka/.config/nvim/lua/misc-plugins.lua:345>
Expected behavior
Hop jumps to the first occurrence of `[
version (please complete the following information):
Additional context
Also f.
jumps to any character. This is wrong behavior for HopChar1
, which ideally should jump to exactly the character specified. It doesn't make much sense from UX perspective to expect the user to provide a regexp. We can't make any proper regexp with just one character, and we eliminate control characters from becoming targets.
At least there should be an option to disable regexpes from Hop.
Edit: I discovered that this behavior started happening in the recent commit: a75b915.
Describe the bug
Error executing Lua callback: ...a/.local/share/vscnvim/plugged/hop.nvim/lua/hop/init.lua:139: Invalid 'end_col': out of range
stack traceback:
[C]: in function 'nvim_buf_set_extmark'
...a/.local/share/vscnvim/plugged/hop.nvim/lua/hop/init.lua:139: in function 'set_unmatched_lines'
...a/.local/share/vscnvim/plugged/hop.nvim/lua/hop/init.lua:155: in function 'apply_dimming'
...a/.local/share/vscnvim/plugged/hop.nvim/lua/hop/init.lua:364: in function 'hint_with_callback'
...a/.local/share/vscnvim/plugged/hop.nvim/lua/hop/init.lua:315: in function 'hint_with'
...a/.local/share/vscnvim/plugged/hop.nvim/lua/hop/init.lua:567: in function 'hint'
...jia/.local/share/vscnvim/plugged/hop.nvim/plugin/hop.lua:59: in function <...jia/.local/share/vscnvim/plugged/hop.nvim/plugin/hop.lua:58>
To Reproduce
Call HopLineBC on any empty lines
version (please complete the following information):
When using HopYankChar1 the first (leftmost or uppermost) character is not included in the yank.
For example if you have text abcdefgh
and select a
as the start character for the yank and h
as the terminating character then the actual yanked text is bcdefgh
. This behavior is the same h
is selected first then a
.
To Reproduce
Initiate command HopYankChar1
, follow the Yank start pattern
prompt to select a start character. Follow the Yank end pattern
prompt to select the end character. Paste the yanked text to see the result.
Expected behavior
The first character should be included instead of excluded. i.e. from the intro abcdefgh
should be in the yank register.
Screenshots
N/A
version (please complete the following information):
Additional context
No additional comments. But thank you for continuing this plugin!
Describe the bug
Setting the case_insensitive = false,
on the opts
key and then running commands like: :HopChar1
doesn't seem to be working
To Reproduce
Steps to reproduce the behavior:
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install hop.nvim
local plugins = {
{
"smoka7/hop.nvim",
opts = {
case_insensitive = false,
}
},
}
require("lazy").setup(plugins,{})
--- How You use hop...
:HopChar1
Expected behavior
It should respect the case_insensitive
prop and only highlight the matching capital letters.
version (please complete the following information):
Colors are overwritten by the plugin no matter what way I try to change them. I believe it's because of commit 90e078a
It is possible when using origin version of the plugin
Describe the bug
The repo is missing tests. Why a repo is should have tests is a given
To Reproduce
Expected behavior
Have tests ran in pull requests
Screenshots
version (please complete the following information):
Additional context
See hadronized#271 for a first approach. Still dunno why was it closed.
Describe the bug
The old HopLine
labeled folds. After switching to this fork, it no longer does so.
To Reproduce
:HopLine
Expected behavior
I expect folded lines to be labeled like the original Hop
did.
Screenshots
Here's the screenshot of the old behavior with folded lines labeled.
Here's the screenshot of the new behavior with folded lines not labeled.
version (please complete the following information):
I've only given the codebase a cursory look so I'm not sure how feasible this is but I've been missing the ;
/,
(or n
/N
) functionality of EasyMotion with its easymotion-next
and easymotion-prev
commands. If the upstream repo shows signs of life I'll transfer this issue there but until then I'll leave it here. If it's doable and within my abilities to implement this then I'll try to get a PR going for this if I find the time.
Describe the bug
When you call any hop command on an empty line with noice
installed, the cursor turns black. This is true with all color schemes.
I have tried
vim.cmd("highlight! link NoiceCursor Cursor")
But this doesn't fix anything.
To Reproduce
<cmd>HopChar1AC<cr>
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install hop.nvim
local plugins = {
{ "smoka7/hop.nvim", opts = {} },
{"folke/noice.nvim", opts = {} },
}
require("lazy").setup(plugins,{})
Expected behavior
I expect the cursor to remain the same color.
Screenshots
With noice
enabled
version (please complete the following information):
"hop.nvim": { "branch": "master", "commit": "5681edd36cf858c821826178e77af78463c1c281" }
Describe the bug
When I have this code (notice the inlay hints which are some kind of virtual text)
and I want to jump to the first '
character. I see this
To Reproduce
Let me know if you would like me to provide code for a full repro. I don't have the time to do it right now as the setup is a bit confusing to me and it will take some time.
Expected behavior
The hop target should be displayed on the '
character. It was unexpectedly displayed on the inlay hint instead.
version (please complete the following information):
NVIM v0.10.0-dev-2086+g965dbd0e0
6d853addd6e11df8338b26e869a29b36f2c3e893
Additional context
My hop config:
---@type LazySpec
return {
"smoka7/hop.nvim",
version = "*",
event = "VeryLazy",
opts = {},
keys = {
{
"<leader>y",
mode = { "n", "x", "o" },
function()
local hop = require("hop")
hop.hint_lines_skip_whitespace({})
end,
desc = "Hop to line",
},
{
"<leader><leader>",
mode = { "n", "x", "o" },
function()
local hop = require("hop")
hop.hint_char1({})
end,
desc = "Hop to given character",
},
},
}
Describe the bug
The cursor is on the position P. Use :HopChar1
to hop somwhere and the ctrl-o
to jump back. Cursor is not on the original position P.
To Reproduce
Configuration:
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{ "smoka7/hop.nvim", opts = {} },
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
Steps to reproduce the behavior:
first
second
third
r
.:HopChar1
, use character i
, so you get two targets (a
in the word first
and s
in the word third
) - choose s
ctrl-o
to jump backf
in the word first
Expected behavior
After jump back by ctrl-o
, you should be on the character r
in the word first
- the place before hop.
Version (please complete the following information):
Additional context
Additionally - in the more complex content, the cursor is not even on the same line after ctrl-o
.
Thank you for maintaining hop.nvim after the original project become unmaintained. However, after switch to this repo this issue appeared. It breaks e.g. following workflow: hop somewhere, cut/yank some content, jump back and put the content there.
Describe the bug
README file points to upstream wiki in phaazon's repo
To Reproduce
Expected behavior
Either migrate wiki or not mention it. Pointing to the upstream wiki could result in confusion as the code in this fork changes through time
Screenshots
version (please complete the following information):
Additional context
Describe the bug
:HopPattern not working. Results in a ipairs
error.
To Reproduce
Steps to reproduce the behavior:
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install hop.nvim
local plugins = {
{ "smoka7/hop.nvim", opts = {} },
}
require("lazy").setup(plugins,{})
--- How You use hop...
:HopPattern
<insert pattern> + Enter
Expected behavior
The pattern searched for gets highlighted.
version (please complete the following information):
Additional context
I need some guidance on configuring custom highlights in this plugin. Currently, I'm using a Lua file to set custom highlights like this:
local function set_hl(group, tbl)
vim.api.nvim_set_hl(0, group, type(tbl) == 'table' and tbl or { fg = tbl })
end
set_hl('HopNextKey', { fg = '#ffffff', bg = '#ff007c', bold = true })
set_hl('HopNextKey1', { fg = '#ffffff', bg = '#00dfff', bold = true })
set_hl('HopNextKey2', { fg = '#ffffff', bg = '#2b8db3' })
set_hl('HopUnmatched', { fg = '#666666', sp = '#666666' })
While this works, I noticed that when I set custom highlights in my Lua file, they get overridden by hop.nvim, making me re-require the Lua file after hop setup.
Is there a more streamlined way to define custom highlights without this overriding issue in hop.nvim? Any guidance or suggestions would be greatly appreciated.
(I have already disabled the 'create_hl_autocmd' option if that's relevant)
Line 586 in 1cbaa79
I feel like a bit of an idiot. In the feature list I see that hop can be used "with commands like v, d, c, y to visually select/delete/change/yank up to your new cursor position." My assumption is that I could initiate, say, delete as usual by pressing the 'd' key. Then I'd be able to press a second key as part of the delete "chord" to invoke hop. Whatever hop matched would be deleted.
I put the following in my init.lua:
vim.api.nvim_set_keymap('n', 'dh', ':HopChar1<CR>', { noremap = true, silent = true })
(Normally dh would delete left, but I wanted to invoke hop instead.)
What this actually seems to do is exit the delete and then do a standard hop.char1. That is, no deletion occurs.
I'm guessing I'm missing something very simple. Could you help me figure out how to properly integrate hop into select/delete/change/yank via key chords? TIA!
Do you know this plugin? https://github.com/Weissle/easy-action.git
If you think this plugin's design is good, I would like to let it integrate with hop.nvim.
I found out about the custom callback feature, so I decided to implement my first one in my neovim config. This simply extends the HopLineStart to immediately enter insert mode on a new line:
local hop = require("hop")
hop.setup({})
local hop_insert_line = function()
local regex = require("hop.jump_regex").regex_by_line_start_skip_whitespace()
local target = require("hop.jump_target").jump_target_generator(regex)
hop.hint_with_callback(target, hop.opts, function(jt)
hop.move_cursor_to(jt, hop.opts)
-- v this the critical line
vim.api.nvim_input("o")
end)
end
vim.keymap.set("n", "go", hop_insert_line)
I feel this is a lot of boilerplate for a single lua command callback to a single default target. Is there an easier way to implement this? If not, could the default targets accept a callback as an optional parameter?
The help documentation is excellent, but it is lacking an example that would have likely saved me some time. Would adding my example to the wiki, hop.txt, or examples make sense?
Describe the bug
When using :HopChar1CurrentLineAC
with the cursor on some character X
, if there is at least one more X
ahead on the line,
:HopChar1CurrentLineAC
creates a jump character for where the cursor is as well as all subsequent X
s.
To Reproduce
Steps to reproduce the behavior:
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install hop.nvim
local plugins = {
{ "smoka7/hop.nvim", opts = {} },
}
require("lazy").setup(plugins,{})
--- How You use hop...
Suppose we have the line live love laugh
with the cursor on the l
on love
. Running :HopChar1CurrentLineAC
will create a jump character to jump on the l
for love
and another one to jump on the l
for laugh
.
Expected behavior
The cursor should jump directly to the l
on love
without creating a jump character, similar to what you would expect with using f,t,F,T.
version (please complete the following information):
Additional context
This also applies to :HopChar1CurrentLineBC (but is perhaps expected behaviour for :HopChar1CurrentLine?)
OS: Windows 10
nvim version: 0.9.1 x86_64
hop.nvim version: smoka7/hop.nvim, tag: v2.2.1
operation: <leader>j
, key mapping on: <cmd>HopLineAC<cr>
in my config - line-31
description: it happens on specific empty line, in above error screenshot, the cursor position is: line-2, column-1.
For short, a buffer in some splits, when using hop.nvim, the prompts in these windows are same. But I want to navigate between these windows, so I need the different prompts for specific window.
You can refer this issue to more specific use case:
Describe the bug
hop.nvim errors when doing require 'hop'.hint_char1({direction = require 'hop.hint'.HintDirection.BEFORE_CURSOR})
To Reproduce
...
:norm G
(make sure you're standing at the last line):lua require 'hop'.hint_char1({direction = require 'hop.hint'.HintDirection.BEFORE_CURSOR})
and input .
E5108: Error executing lua: .../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:139: Invalid 'end_col': out of range
stack traceback:
[C]: in function 'nvim_buf_set_extmark'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:139: in function 'set_unmatched_lines'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:155: in function 'apply_dimming'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:364: in function 'hint_with_callback'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:315: in function 'hint_with'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:519: in function 'hint_char1'
/home/user/.config/nvim/lua/custom/plugins/init.lua:29: in function </home/user/.config/nvim/lua/custom/plugins/init.lua:25>
Expected behavior
hop offers candidates to jump to any of the three .
s in the first line
Screenshots
NA
version (please complete the following information):
Additional context
NA
Re-raising this issue from the original repo: hadronized#276
When I use
:HopChar1
, the statusline changes toHop 1 Char:
. However, this does not go away after hopping when using more than 1 line for the statusline (when thecmdheight
option is greater than 1).Would it be possible to clear the prompt after hopping no matter how large the statusline is?
Describe the bug
vim throws an error when doing hop_char1(direction=HintDirection.AFTER_CURSOR)
from an empty line (HintDirection.BEFORE_CURSOR
works ok, though)
To Reproduce
Steps to reproduce the behavior:
o
, write any character twice (say ..
)gg
)lua require 'hop'.hint_char1({direction = require 'hop.hint'.HintDirection.AFTER_CURSOR})
and enter the chacter (.
, see step 2)E5108: Error executing lua: .../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:139: Invalid 'col': out of range
stack traceback:
[C]: in function 'nvim_buf_set_extmark'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:139: in function 'set_unmatched_lines'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:155: in function 'apply_dimming'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:364: in function 'hint_with_callback'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:315: in function 'hint_with'
.../user/.local/share/nvim/lazy/hop.nvim/lua/hop/init.lua:519: in function 'hint_char1'
/home/user/.config/nvim/lua/custom/plugins/init.lua:62: in function </home/user/.config/nvim/lua/custom/plugins/init.lua:58>
Expected behavior
If you add a space to the empty line, everything behaves as expected
Screenshots
NA
version (please complete the following information):
Additional context
NA
hint_nodes looks legit, but I find I want to go beyond "current surrounding"
I'm currently using hint_words, which feels sliiiiightly too verbose?
Hi,
Thanks for maintaining this plugin.
The wiki and internal documentation indicate to use create_hl_autocmd = false
(:help hop-config-create_hl_autocmd
)
It doesn't work anymore since 90e078a as reported in #20.
Is it possible to restore this option?
Some colorshemes (like gruvbox-materiel ans others) customize highlights for popular plugins like hop.
version (please complete the following information):
nvim-treehopper works fine with original hop, but not with this fork.
E5108: Error executing lua: ...ugel/.local/share/nvim/lazy/nvim-treehopper/lua/tsht.lua:301: ...rugel/.local/share/nvim/lazy/hop.nvim/lua/hop/window.lua:74: attempt to index local 'opts' (a nil value)
stack traceback:
[builtin#36]: at 0x01047bc61c
...ugel/.local/share/nvim/lazy/nvim-treehopper/lua/tsht.lua:301: in function 'move'
/Users/bruno.krugel/.config/nvim/lua/custom/mappings.lua:405: in function </Users/bruno.krugel/.config/nvim/lua/custom/mappings.lua:404>
Thank you for picking up this awesome plugin. I'm really enjoying it!
The wiki is still referring to the old repo phaazon/hop.nvim
. Is it possible that the wiki will allow community edit (or at least submit a PR) so that people can update and improve upon it?
Thank you again!
Sup smoka! I would finally like to contribute to hop. I mostly use t
and T
to jump on the current line for faster navigation. Let me quickly brush over what's bugging me.
Lets consider the following line:
compact_success_msg "Plugins cloned successfully."
Often you use motions such as ciw
to quickly change a word and lets say I want to change the word success
from the line above unfortunately ciw
wont to the trick here neither does b
or e
as compact_success_msg
is the whole node and none of these motions are aware of the substring success
. So the simple solution is to use something like hop current line
to quickly jump where you want the cursor to be.
Now my cursor is on the first s
of the substring success
and invoking my jump will leave me with the following options:
Depending on the length of the line this won't allow me to consistently establish a muscle memory for selecting the current actual word success
because the hop selection counts all occurrences of the substring s
on the current line and in case of the substring Plugins
I'm presented with the jumptarget v
instead of t
.
This got me thinking that it could be useful to implement text object awarness to assign jumptargets in the current context to have a more consisten set of jump targets. Note: this enavitibly opens up a variety of new features of jumping behaviours such incremental adding of jump targets or a range of jump targets where the user is supposed to define two jump targets instead of one to make a selection for example.
This also opens up a variety of ways this could be implemented I wanted to know how you envision the future of hop and what I can do to help. Would be great if we could discuss the details. One possible way is to provide different schema queries from treesitter for different languages for example.
Describe the bug
When I have two vertical windows and I try to hop from the one of them, I randomly get the following error.
Error executing Lua callback: ...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:110: attempt to get length of a nil value
stack traceback:
...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:110: in function 'set_unmatched_lines'
...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:164: in function 'apply_dimming'
...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:373: in function 'hint_with_callback'
...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:324: in function 'hint_with'
...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:471: in function <...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:464>
This happens after upgrading to the lastest version.
To Reproduce
Steps to reproduce the behavior:
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install hop.nvim
local plugins = {
{ "smoka7/hop.nvim", opts = {} },
}
require("lazy").setup(plugins,{})
--- How You use hop...
Expected behavior
Jump markers should appear without any error
Screenshots
version (please complete the following information):
Describe the bug
HopVertical
command not work
To Reproduce
Steps to reproduce the behavior:
In nvim Command mode exec HopVertical
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install hop.nvim:
editor["smoka7/hop.nvim"] = {
lazy = true,
event = "VeryLazy",
config = require("editor.hop"),
}
--- How You use hop...
Expected behavior
In nvim command mode exec HopVertical
, it work
Screenshots
If applicable, add screenshots to help explain your problem.
version (please complete the following information):
Additional context
Add any other context about the problem here.
Describe the bug
When using <cmd>HopLineAC<cr>
or <cmd>HopLineBC<cr>
to jump to below/above lines, there's an error:
To Reproduce
Install hop.nvim with lazy.nvim:
{
"smoka7/hop.nvim",
version = "*",
config = function()
require("hop").setup()
end,
},
I found in below lua
file, it can always re-produce this issue.
Here's the file link: https://github.com/linrongbin16/fzfx.nvim/blob/2f7425cf7fdb94814eb98295f3fb7851daace68d/spec/lib/switches_spec.lua?plain=1#L13
local cwd = vim.fn.getcwd()
describe("lib.switches", function()
local assert_eq = assert.is_equal
local assert_true = assert.is_true
local assert_false = assert.is_false
before_each(function()
vim.api.nvim_command("cd " .. cwd)
end)
local switches = require("fzfx.lib.switches")
describe("[fzfx_disable_buffer_previewer]", function()
it("disabled", function()
vim.g.fzfx_disable_buffer_previewer = 1
assert_true(switches.buffer_previewer_disabled())
vim.g.fzfx_disable_buffer_previewer = true
assert_true(switches.buffer_previewer_disabled())
vim.g.fzfx_disable_buffer_previewer = "true"
assert_false(switches.buffer_previewer_disabled())
vim.g.fzfx_disable_buffer_previewer = nil
assert_false(switches.buffer_previewer_disabled())
end)
it("enabled", function()
vim.g.fzfx_disable_buffer_previewer = 0
assert_false(switches.buffer_previewer_disabled())
vim.g.fzfx_disable_buffer_previewer = false
assert_false(switches.buffer_previewer_disabled())
vim.g.fzfx_disable_buffer_previewer = "false"
assert_false(switches.buffer_previewer_disabled())
vim.g.fzfx_disable_buffer_previewer = nil
assert_false(switches.buffer_previewer_disabled())
end)
end)
end)
The re-produce steps are:
function()
).<S-V>
to enter visual mode (and current line is selected).G
to go to bottom line (and from the start line to the bottom line are all selected).<Leader>k
(I mapped this key to <cmd>HopLineBC<cr>
) to jump to above lines.Expected behavior
Don't throw exception, and jump correctly.
Screenshots
See above.
version (please complete the following information):
NVIM v0.10.1
, Build type: Release
.v2.7.0
.Additional context
N/A.
There's no v2
branch in this git repo, please update installation in README.
I would like to be able to rely on the first 3 hops ( read top to bottom, left to right ) being labeled 'a', 's', 'd' ( rather than Manhattan distance ). For example, in the following case:
abcdefghijklmnopqrstuvwxyz
this is the z i mean
If I start with my cursor on the k and single char hop to "z", the "a" ends up on the z on the line below, which frequently leads to me deleting more than I intend, since I always scan lines left to right before top to bottom.
I would like to provide my own scoring function ( rather than xbias ) which always orders higher lines first and always orders leftmost characters first. That way I can rely on usages like: "dft<target>a
" always being safe ( and especially, means in the common case I don't even need to read the targets -- even if it's additional keystrokes it is a sequence I can rely on ).
I'm happy to take a stab at the changes myself if there's appetite for it!
My initial thought was that config could just take a custom function similar to x_bias which receives the same parameters ( minus bias of course ).
Thanks for maintaining this nice plugin. I was trying to configure a key binding for operator pending mode which deletes several lines at once. For this a tried to add this configuration:
vim.keymap.set('', '<Space>j', function()
hop.hint_lines({ direction = directions.AFTER_CURSOR, current_line_only = false })
end, {remap=true})
It works great to jump to a line in normal mode, but operator mode behaves a bit odd. In this example text (cursor position marked with |
)
ab|c
def
ghi
I would expect to delete all lines when jumping to the last line with d<Space>j
. Instead, the text
abhi
is left in the buffer. Is it somehow possible to tell hop to work on whole lines?
First things first
First of all: Thank you so much for this great plugin, i love it a lot and appreciate the work!
Describe the bug
The HopWordMW
user command does not allow me to hop to a window outside a terminal buffer (in normal mode).
To Reproduce
I have this configuration:
-- install and configure hop.nvim
{
'smoka7/hop.nvim', -- hopping arround
version = "*",
config = function()
require('hop').setup {
multi_windows = true,
}
end
},
-- hop arround anywhere cross windows
vim.api.nvim_set_keymap("n", "f", "<cmd>HopWordMW<CR>",
{ noremap = true, silent = true, desc = "Hop anywhere cross windows" })
Expected behavior
Use the command mapping to hop from any visible split window to any other visible split window.
Screenshots
hop'ing from a normal text buffer (multi windows works)r:
hop'ing from a terminal buffer in normal mode (multi windows does not work on my machine):
version (please complete the following information):
NVIM v0.9.2
Build type: Release
LuaJIT 2.1.0-beta3
with latest hop version:
version 2.3.1
tag v2.3.1
branch master
commit f2508f4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.